audio_format query parameter. The default is pcm_16000.
Supported formats
All formats are mono. Send raw samples only: no WAV or other file header, no container, and no compression beyond G.711. Stereo audio must be mixed down to one channel first.
An unsupported
audio_format is rejected with an error event and close code 1008.
Declare the rate you send
audio_format must match the audio exactly. Audio at a different rate than declared is not rejected: it is transcribed as sped-up or slowed-down speech, which produces wrong text. If transcripts look plausible but wrong, check the sample rate first.
Send audio at the rate it was captured or recorded. You do not need to resample it yourself: Chariot converts every supported rate on the server.
Telephony
Phone audio is usually 8 kHz G.711. Declare the encoding your provider delivers and send its bytes unchanged:
Check your provider’s media settings to confirm which one it sends. Mixing them up produces noisy, unusable transcripts.
Many telephony media streams wrap audio in JSON messages as base64. Decode the base64 and send the raw bytes to Chariot as binary frames.
For a phone call, open one session per call leg you want transcribed. Each session uses one concurrency slot for as long as it is open.
Chunk size
Any frame size works, and a frame does not have to end on a sample boundary. Frames of 50 to 200 ms work well for live audio. Smaller frames add per-message overhead, and larger frames delay the first text by up to the frame length.
With a live source, send each frame as soon as you have it. With a recording, the quickstart paces frames at real time to behave like a microphone.
Silence and pauses
Every second of audio you send is billed, including silence. Text for your most recent speech arrives only after more audio follows it, andhigh_accuracy holds back more of it than balanced. For live conversations, keep streaming through short pauses, silence included, so that text arrives during the pause.
When there is no audio at all, for example while a microphone is muted, stop sending frames and send {"type": "keepalive"} messages instead. They keep the session open and are not billed, but they do not bring out held-back text. That text arrives when audio resumes or when you send input.done. See Keeping a session open.
Browser microphones
Browsers capture audio as 32-bit floating-point samples, usually at 48 kHz (readAudioContext.sampleRate to be sure). Convert each block to 16-bit integers and declare the matching format, for example pcm_48000:
JavaScript