Movatterモバイル変換


[0]ホーム

URL:


🚀 Introducing Flux, the first conversational speech recognition model built for voice agents. (Learn more!)🚀

HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
On this page
Tips and Tricks

TTS Troubleshooting WebSocket, NET, and DATA 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.

WebSocket Basics

  • WebSocket enables two-way, real-time communication between client and server.
  • The connection is established via an HTTP handshake and upgraded to WebSocket.
  • If the handshake fails, you’ll get an HTTP4xx or5xx error.
  • The connection stays open until closed by either side.

Establishing a WebSocket Connection

  • The client initiates a WebSocket connection with an HTTP handshake, optionally including query parameters or headers (for authentication, etc.).
  • Most libraries handle the handshake automatically (e.g.,websockets.connect).
  • If successful, the server responds with HTTP101 and upgrades the connection.
  • If unsuccessful, you’ll receive an HTTP4xx or5xx error and the connection won’t be established.

Closing the WebSocket Connection

  • A successfully opened WebSocket connection will stay alive until it is eventually closed by either the client or the server. When this occurs, aWebSocket Close Frame will be returned.
  • The body of the Close frame will indicate the reason for closing with apre-defined status code followed by a UTF-8-encoded payload that represents the reason for the error.
  • To close the WebSocket connection from your client, send aClose message. The server will then finish processing any remaining data, send a final response and summary metadata, and terminate the connection.
  • After sending a Close message, the endpoint considers the WebSocket connection closed and will close the underlying TCP connection.

Common WebSocket Errors

Failure to Connect

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.

Debugging Connection Failures

If you’re unable to connect the Deepgram API provides custom HTTP headers that contain debugging information:

  • Regardless of the success or failure of the WebSocket upgrade, all requests include thedg-request-id HTTP header, which contains the request ID.
  • Requests that do not successfully upgrade to a WebSocket connection also include thedg-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.

Abrupt WebSocket Closures

If Deepgram encounters an error during real-time streaming, the Deepgram API returns aWebSocket Close frame. The body of the Close frame will indicate the reason for closing with apre-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.

CodePayloadDescription
1003MESSAGE-0000Input message isn’t a supported websocket message type.
1008DATA-0000Input message isn’t recognized as a valid command.
1008DATA-0001Too many input characters submitted in recent time window.
1009BIG-0000Input message is too large.
1009BIG-0001Input text has too many characters.
1011NET-0000Internal server error.
1011NET-0001Failed to receive message.
1011NET-0002Failed to send message.
1011NET-0003Time limit exceeded.

Troubleshooting1003 -MESSAGE-0000

  • Ensure you are sending supported TTS WebSocket message types oftext.
  • Refer to theDocumentation for valid message types.

Troubleshooting1008 -DATA-0000

  • Make sure your message is a valid message type.
  • Refer to theDocumentation for valid message types.

Troubleshooting1008 -DATA-0001

  • Reduce the rate at which you are sending characters into the websocket via input messages.
  • The limit is on the total number of characters submitted for speaking, not the distinct number of input messages used to submit those characters.
  • Check theDocumentation for the maximum allowed character limit.

Troubleshooting1009 -BIG-0000

  • Reduce the size of your input message.
  • If sending large blocks of text, consider splitting it into smaller chunks.
  • Check theDocumentation for the maximum allowed request body size.

Troubleshooting1009 -BIG-0001

  • Shorten your input text to stay within character limits.
  • Check theDocumentation for the maximum allowed character limit.

Troubleshooting1011 -NET-0000

  • This indicates an internal server error.
  • Retry your request.
  • If the error persists, checkDeepgram status for outages.
  • Contact Support if the issue continues.

Troubleshooting1011 -NET-0001

  • The server did not receive a message from the client in time.
  • Ensure your client is sending data promptly after connecting.
  • Check for network issues or dropped connections.
  • Retry the connection if needed.

Troubleshooting1011 -NET-0002

  • The server failed to send a message to the client.
  • Check your network connection and firewall settings.
  • Retry the request.
  • If the problem persists,contact Support.

Troubleshooting1011 -NET-0003

  • The request took too long to complete (time limit exceeded).
  • Try reducing the size or complexity of your request.
  • Ensure your client is not waiting too long before sending or receiving data.
  • Retry the request if appropriate.


[8]ページ先頭

©2009-2025 Movatter.jp