Skip to content

Audio Formats

All speech-to-text endpoints accept audio in two ways: a container format that the server detects automatically, or raw audio described explicitly with the encoding, sample_rate, and channels query parameters.

With the default encoding=auto, the server detects the audio format by reading the container headers at the start of the data. Most common formats (WAV, M4A, MP3, OGG, FLAC, WebM, etc.) are supported.

On the Prerecorded endpoint, you can also set a seekable media container explicitly: m4a, m4v, mp4, mov, 3gp, or 3g2.

If you are sending raw audio without container headers, set the encoding parameter explicitly along with sample_rate and channels:

Encoding Description
pcm_s16le Raw PCM, 16-bit little-endian
mulaw G.711 mu-law telephony audio
alaw G.711 A-law telephony audio

When streaming to the Realtime or Turns endpoint, you can use a container with an indefinite length (e.g. a WAV header with the data size set to the maximum value) and continuously append audio frames.