-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any chance you could provide some guidance on how to use this? #1
Comments
The container process starts a HTTP server (default on port 8080). Most of the HTTP plumbing happens inside the server handler: https://github.com/mhilker/transcriber/blob/master/cmd/server/main.go#L55 Currently, it works like this:
If everything works correct, you will get back a JSON response with an object containing the hypothesis and the score. I've used the API like this (be aware this is FLOW flavoured JS, your milage may vary): // @flow
type Transcription = {
hypothesis: string,
score: number,
}
const url = process.env.REACT_APP_API_URL || '';
export default async function (blob: Blob): Promise<Transcription> {
const response = await fetch(url, {
method: 'POST',
body: blob,
headers: {
'Content-Type': 'audio/webm',
},
});
const json = await response.json();
console.log(json);
return {
hypothesis: json.hypothesis || '',
score: json.score || 0.0,
};
} Please let me know if this helps. |
I have successfully built the Docker image and spun it up, but I do not understand how to process a file. Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: