Audio formats
Codecs, sample rates, channels, chunk sizes and message limits for every Krisp API endpoint, in one table.
Every Krisp API endpoint sends and receives audio as binary WebSocket messages, after the client hello and the server's ready message. JSON messages travel as text messages on the same connection. This page collects the audio rules from the endpoint pages.
Input audio
| Endpoint | Codec | Sample rate | Channels | Recommended chunk | Set in the client hello |
|---|---|---|---|---|---|
/stt | pcm_s16le (default) or opus | 16,000 Hz only | 1 (mono) | 80 ms, or a multiple of 80 ms | audio_format, sample_rate, channels |
/vt | pcm_s16le (default) or opus | 16,000 Hz only | 1 (mono) | 20 ms (640 bytes at 16 kHz), the Voice Translation SDK default | config.audio.format, config.audio.sample_rate, config.audio.channels |
/voice-isolation | 16-bit PCM | 8,000 or 16,000 Hz (default 16,000) | 1 (mono) | Exactly 30 ms per message (480 bytes at 8 kHz, 960 bytes at 16 kHz). Other sizes end the session with invalid_frame_duration. | sample_rate |
/tts | No audio input: you send text as JSON messages. |
pcm_s16le is raw PCM: signed 16-bit, little-endian samples with no WAV header. With opus, send one Opus packet per message.
Output audio
| Endpoint | What comes back |
|---|---|
/stt | No audio. Transcripts and turn events as JSON text messages. |
/vt | Translated speech as binary messages, in the codec you set in config.audio.format, 16 kHz mono. Optional transcripts and translations as JSON text messages. |
/voice-isolation | Cleaned audio as binary messages: 16-bit mono PCM at the same sample rate, one frame back for each frame you send. |
/tts | Synthesized speech as binary messages, always 16-bit mono PCM at 24 kHz. |
Limits
- Message size: each message you send after the hello can be at most 65,536 bytes (64 KB). Larger messages get the
chunk_too_largeerror (HTTP 413) and the connection is closed with code1009. - Client hello: send it within 15 seconds of connecting.
metadatain the hello can be at most 4 KB. - Pace: stream audio at real-time pace. For example, send an 80 ms chunk every 80 ms.
See the API overview for the full session protocol and the common error codes.
Chunk size in bytes
For 16-bit mono PCM, one millisecond of audio is sample_rate / 1000 × 2 bytes:
| Sample rate | 20 ms | 30 ms | 80 ms |
|---|---|---|---|
| 8,000 Hz | 320 bytes | 480 bytes | 1,280 bytes |
| 16,000 Hz | 640 bytes | 960 bytes | 2,560 bytes |
Convert a file
To convert any audio file to 16 kHz, mono, 16-bit PCM WAV with ffmpeg:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -sample_fmt s16 output.wavWhen you stream the WAV file, skip the header and send only the samples, for example with Python's wave.readframes(), as the examples on each endpoint page do.
Updated about 14 hours ago

