The websocket works but no transcriptions are returned after it is reestablished #549
Replies: 5 comments
-
Thanks for asking your question about Deepgram! If you didn't already include it in your post, please be sure to add as much detail as possible so we can assist you efficiently, such as:
|
Beta Was this translation helpful? Give feedback.
-
Ah, I sorted it out for the most part. Looks like I was very "ungracefully" closing the WebSocket and Deepgram didn't like that. Graceful closure as shown in the docs and code below seems to work. I'm curious though, does anyone know why forcing the WebSocket to close isn't good enough? It's surprising to me that the Deepgram API keeps some state about my webapp instance and "knows it's me" when I reconnect after destroying socket. Is this a browser thing? Interestingly there's no issue when I close and reopen the tab... I guess Chrome handles the WebSocket closure gracefully as well? Or can deepgram just not "tell that it's me" in that case? Or just MAYBE I just need to go and learn how websockets actually work lol Anyways here's the updated code. Thoughts always welcome:
|
Beta Was this translation helpful? Give feedback.
-
Hi @benripka, thanks for sharing your code, glad you were able to work through this for the most part. Were you seeing any error messages on reconnection, or rather it seemed to be connecting properly, but you were getting a blank transcript? I see the request ID |
Beta Was this translation helpful? Give feedback.
-
I have similar issue after reconnecting to deepgram. I have tried everything to terminate the existing connections using .finalize(), .finish() but nothing seems work. Get the metadata response back, but no new transcription message. |
Beta Was this translation helpful? Give feedback.
-
There are similar issues here that slow down the implementation of any integration. |
Beta Was this translation helpful? Give feedback.
-
Hi there! The below code works great on the first startRecording() call, but after calling stopRecording() and then starting it again with startRecording() the websocket is opened back up and valid audio data appears to be getting streamed to Deepgram, however Deepgram returns nothing back... then after a few second Deepgram closes the conection with:
{ "type": "Metadata", "transaction_key": "deprecated", "request_id": "f72438cc-681c-4443-abab-03bbf00384a9", "sha256": "01ebbdc099da1562e201779dd86614d08df898bc9ab5529e4bed88658a0733d2", "created": "2024-01-23T02:21:49.928Z", "duration": 0, "channels": 0 }
I am connecting to the base url: wss://api.deepgram.com/v1/listen
Beta Was this translation helpful? Give feedback.
All reactions