#Resetting data sent

1 messages · Page 1 of 1 (latest)

steady oracle
#

Hi,

Short of making a new websocket and reconnecting it, I wondered if there's a method of either resetting voice sent via streaming and/or more explicitly telling the websocket when to start and stop listening?

I notice an occasional edge case where I've received an 'is_final' and 'speech_final' such as this:

*"is_final":true,"speech_final":true,"channel":{"alternatives":[{"transcript":"Tell me more about the pain and tell me what's bothering you." *

But the user still has spoken a little after that message which has been sent to Deepgram before receiving the "is_final or "speech_final" for the previous sentence (a message like the one above). But I want to ignore that extra audio and wipe any extra audio that was recorded until the user has indicated they wish to record again. During this period I send Keep Alive messages to keep the socket alive.

But when the recording is activated again, it seems to resume where it was left off and process the short snippet that was spoken in the earlier session. For example receiving this:

"is_final":true,"speech_final":true,"channel":{"alternatives":[{"transcript":"Let's","confidence":0.7102554,"words":[{"word":"let's"

Is there a way of just telling Deepgram to stop transcribing or reset itself when I start recording again? Or am I better off just restarting the socket? Or if there's any good samples on how I should create a push to talk system with streaming, that might help!

Thanks!

golden craneBOT
#

Thanks for asking your question. Please be sure to reply with as much detail as possible so we can assist you efficiently. Such as:

  • Provide the request_id if you've a question about a transcription response.
  • The options you used or the api.deepgram.com URL you sent your request to, including parameters.
  • Any code snippets you can include.
  • Any audio you can include, or if you can't share it here please email it to us at [email protected] and provide a link to this thread.
untold trout
fair socket
#

If you're able to detect the case, you [send finalize](#1227378414768361562 message), consume and discard the result and then send the new audio.