Great question. It depends on how you're hitting the API. If you are using the Node SDK you'd use the finish function, as in:
finish
const deepgramSocket = deepgram.transcription.live({ punctuate: true }); deepgramSocket.finish();
If you're communicating with the WebSocket directly with JavaScript you can send a new Uint8Array, as in:
socket.send(new Uint8Array(0));
When the Deepgram API receives that it will finish transcribing the audio, send a final transcript, and then close the WebSocket connection.
Appreciate the response. What about good old Python please?
P.S. Great Twitch btw, really enjoyed it.
Thanks!
For the Python SDK:
deepgramLive = await deepgram.transcription.live() await deepgramLive.finish()
Against the WebSocket without the SDK would be something like:
await socket.send(b'')
Thanks for coming to the stream today!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great question. It depends on how you're hitting the API. If you are using the Node SDK you'd use the
finish
function, as in:If you're communicating with the WebSocket directly with JavaScript you can send a new Uint8Array, as in:
When the Deepgram API receives that it will finish transcribing the audio, send a final transcript, and then close the WebSocket connection.
Appreciate the response.
What about good old Python please?
P.S. Great Twitch btw, really enjoyed it.
Thanks!
For the Python SDK:
Against the WebSocket without the SDK would be something like:
Thanks for coming to the stream today!