#Do you provide close in stt sdk?
1 messages · Page 1 of 1 (latest)
Hi @next estuary. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, Deepgram provides methods to close streaming connections in its Speech-to-Text SDKs across different programming languages.
For the JavaScript/Node.js SDK:
- You can use the
requestClose()method on theLiveClientinstance to close the WebSocket connection to Deepgram Node SDK Streaming Transcription.
For closing streams in other languages:
In Python:
- You can send a close message using
await close_websocket(ws)where the function sends a JSON message with{"type": "CloseStream"}Python Code Samples.
In .NET:
- The SDK provides a
Stop()method that signals to Deepgram that you've finished streaming audio and it should conclude transcription .NET SDK Streaming Transcription.
In JavaScript with WebSockets:
- You can send a JSON message with
{"type": "CloseStream"}to close the connection Close Stream.
The CloseStream message instructs the server to finish processing any cached data, send the final response along with summary metadata, and then terminate the WebSocket connection gracefully Close Stream Conclusion.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@next estuary Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@sudden rain I was wondering if live streaming stt has close() method such as dgConnection.close()
Let me check the knowledge base for you again. One moment! :books:
Based on the knowledge sources, Deepgram's SDKs provide different methods for closing live streaming STT connections, but the exact method name varies by language/SDK:
In the Python SDK, the method is called finish():
dg_connection.finish()
Live Streaming Audio Transcription
In the Node.js/JavaScript SDK, the method is called requestClose():
live.requestClose();
Node SDK Streaming Transcription
If you're using lower-level WebSockets directly (without an SDK), you would send a JSON message with the CloseStream type:
dgLiveObj.send(JSON.stringify({ 'type': 'CloseStream' }));