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: Upgradeheader).
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_ratefrom yourinitconfig. - 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
encodingandsample_ratein yourinitconfig 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:Getting help
- Email: support@slng.ai
- Discord: discord.gg/slng