Overview
Send audio as binary WebSocket frames aftersession_ready. The format you stream must match what you declared in the audio object of your config. Frames may be any length — the server re-frames the stream internally.
Recommended: raw 16-bit PCM (
pcm_s16le), 16 kHz, mono. This is the lowest-overhead, best-supported format.Format
Encoding
pcm_s16le— raw 16-bit little-endian PCM (preferred)wav— WAV container
Stream shape
- Binary frames, any length
- Server re-frames internally
- No client-side segment alignment needed
Sample rate
Accepted range 8000–48000 Hz.
16000 is recommended and is what most integrations should send.Channels
1 (mono, recommended) or 2. Mono keeps bandwidth and processing minimal; use it unless you have a specific reason not to.| Setting | Recommended | Accepted |
|---|---|---|
| Encoding | pcm_s16le | pcm_s16le, wav |
| Sample rate | 16000 Hz | 8000–48000 Hz |
| Channels | 1 (mono) | 1 or 2 |
| Bit depth | 16-bit | 16-bit |
For
pcm_s16le, send interleaved signed 16-bit samples with no WAV header. For wav, the container header is read from the stream.Chunking guidance
You do not chunk on segment boundaries — the server decides where segments end. Two independent things are worth getting right:- How often you send binary frames (transport pacing).
- Which
chunk.strategyyou choose (how the server finalizes segments).
Transport pacing
Send audio at roughly real time, in small frames. Frames of about 20–100 ms of audio (for example ~640–3200 bytes at 16 kHz monopcm_s16le) keep captions responsive without flooding the socket.
Choosing a strategy
Thechunk.strategy trades latency against accuracy and text density. Pick by behavior, not by frame size:
low_latency
Shortest segments, fastest captions. Best for live on-screen dictation.
balanced
The default. Strong accuracy while still feeling live.
high_throughput
Longest segments, highest accuracy and density. Best when a little extra delay is acceptable.
Browser capture example
Streaming a file
To transcribe a pre-recorded file, decode it to 16 kHz monopcm_s16le and send it paced to real time (or slightly faster), watching for backpressure. For whole-file, non-real-time transcription, use the batch transcription flow instead of this live socket.
No transcripts arriving
No transcripts arriving
- Confirm you waited for
session_readybefore sending audio. - Confirm the bytes match your declared
encoding,sample_rate, andchannels. - Confirm you are sending binary frames (not base64 or JSON).
- Very short bursts of audio may not finalize until more speech (or an
end_utterance) arrives.
Choppy or delayed captions
Choppy or delayed captions
- Switch
chunk.strategytolow_latencyfor faster segments. - Send smaller frames closer to real time.
- Check for
backpressureframes — if present, you are sending too fast.
Wrong or mixed language
Wrong or mixed language
- Provide a
languagehint in your config to bias detection. - Detection is automatic and per-segment; mid-conversation switches are expected and handled.
Next steps
Messages
Send audio and control frames; read transcripts.
Session config
Declare your audio format and chunk strategy.