> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio requirements

> Duration, format, and sample-rate constraints for Dictation audio.

The Dictation API accepts short clips with the following constraints:

| Constraint       | Value                                            |
| ---------------- | ------------------------------------------------ |
| Maximum duration | 120 s                                            |
| Sample width     | 16-bit only                                      |
| Formats          | WAV (`audio/wav`) or raw PCM S16LE (`audio/pcm`) |

Set the `audio` part's Content-Type to match the format you send. Compressed
formats (MP3, M4A, FLAC, OGG, and WebM) are rejected with `415`.

## WAV and raw PCM

For WAV, the sample rate and channel count are read from the file header, and
the `sample_rate` and `channels` config fields are ignored.

For raw PCM there is no header to read, so both fields are required in the
`config` part:

```json theme={null}
{ "sample_rate": 16000, "channels": 1 }
```

Raw PCM is the easier format to upload while the user is still speaking, since
frames can go on the wire as they come off the microphone with no container to
finalize. See [Uploading while recording](/docs/dictation#uploading-while-recording).

## When audio is rejected

Audio that violates a constraint is rejected with a `400`, `413`, or `415`. On
a chunked upload the `413` can arrive part-way through the request rather than
at the end, because the server is measuring the audio as it arrives. See
[Error handling](/docs/dictation/error-handling) for the full table.

For audio longer than 120 seconds, use
[Pre-recorded STT](/docs/pre-recorded-audio/getting-started/transcribe-an-audio-file).
For a live transcript while the speaker is still talking, use
[Real-time STT](/docs/streaming/getting-started/transcribe-streaming-audio).
