Skip to main content

Authentication errors

WebSocket errors

Pronunciation dictionary errors

WebSocket pronunciation errors return an error frame:

Common issues

Connection drops

WebSocket disconnects unexpectedly.
  • Implement reconnection with exponential backoff (1s, 2s, 4s, up to 30s).
  • Send periodic keep-alive messages ({"type": "keepalive"} for STT) to prevent idle timeouts.
  • If behind a corporate proxy, confirm it supports WebSocket upgrades (the Connection: Upgrade header).

Choppy or distorted audio (TTS)

  • Buffer at least 200ms of audio before starting playback.
  • Use the WebAudio API (AudioContext) instead of <audio> elements for gapless chunk playback.
  • Confirm your player’s sample rate matches the sample_rate from your init config.
  • 24kHz linear16 audio requires roughly 384 kbps. Verify your connection can sustain it.

Delayed transcriptions (STT)

  • Send audio in 20-100ms chunks (320-1600 bytes at 16kHz linear16).
  • Confirm encoding and sample_rate in your init config match your actual audio format.
  • For real-time use, prefer Deepgram Nova, which is optimized for streaming latency.

Audio format mismatch

Keep your audio configuration consistent across the pipeline:
Your audio capture must match: 16-bit samples, 16000 Hz, single channel (mono).

Getting help