deepgram / deepgram-dotnet-sdk

.NET SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
33 stars 31 forks source link

Live transcription silence is being treated as an error #133

Closed acidbubbles closed 1 year ago

acidbubbles commented 1 year ago

What is the current behavior?

Once I establish a connection, if I'm not sending audio in the next 20-30 seconds, I receive this message:

Deepgram did not provide a response message within the timeout window. See https://dpgr.am/net0000

Steps to reproduce

Connect but don't send bytes and wait (with the keep alive working)

Expected behavior

I would expect the connection to stay open as long as I call keep alive, so I can start sending bytes when the user speaks without having to connect, OR for the reconnection and keep-alive logic to be handled internally by the library.

Please tell us about your environment

Other information

I wan't sure if this is a bug or a feature, but since the documentation for net0000 doesn't say much about this situation, and there's already a keepalive to ensure continued connections, this behavior seemed surprising to me.

acidbubbles commented 1 year ago

I guess the follow up question would be, if this is by design, what should be the best practice? Parse the error for "net0000" and reconnect automatically? Or should I do audio processing to ensure there is relevant data beforehand?

If we need to reconnect only when hearing audio, that means I need to buffer audio until the connection is successful rather than streaming them, so for the record I'm not a fan of this option :)

jjmaldonis commented 1 year ago

Related to #131 This will be fixed by #132

jjmaldonis commented 1 year ago

Fixed in #132