TTS Troubleshooting WebSocket, NET, and DATA Errors
Learn how to debug common real-time, live streaming text-to-speech errors.
Learn how to debug common real-time, live streaming text-to-speech errors.
When working with Deepgram’s Text To Speech Streaming API, you may encounter WebSocket errors. This troubleshooting guide helps you quickly identify and resolve the most common issues.
4xx or 5xx error.websockets.connect).101 and upgrades the connection.4xx or 5xx error and the connection won’t be established.If a failure to connect occurs, Deepgram returns custom HTTP headers for debugging:
dg-request-id: Always present, contains the request ID.dg-error: Present on failed upgrades, contains the error message.Access to these headers will depend on the WebSocket library you are using. For example, browser-based WebSocket libraries like the JavaScript WebSocket library only allow access to HTTP header information for successful WebSocket connections.
If you’re unable to connect the Deepgram API provides custom HTTP headers that contain debugging information:
dg-request-id HTTP header, which contains the request ID.dg-error HTTP header, which contains a detailed error message concerning why the connection could not be upgraded. This error message is also sent back in the body of the HTTP response.If Deepgram encounters an error during real-time streaming, the Deepgram API returns a WebSocket Close frame. The body of the Close frame will indicate the reason for closing with a pre-defined status code followed by a UTF-8-encoded payload that represents the reason for the error.
Below are the most common WebSocket Close frame status codes and their descriptions.
1003 - MESSAGE-0000text.1008 - DATA-00001008 - DATA-00011009 - BIG-00001009 - BIG-00011011 - NET-00001011 - NET-00011011 - NET-00021011 - NET-0003