> ## 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.

Dictation has two transcription endpoints with different limits.
`/v1/transcribe/live` takes audio while it is still being recorded and is what
the SDKs use. `/v1/transcribe` takes a finished recording over HTTP; see
[Transcribing a finished recording](https://assemblyai.com/docs/dictation.md#transcribing-a-finished-recording).

| Constraint | `/v1/transcribe/live` (SDKs and HTTP) | `/v1/transcribe` (HTTP) |
| - | - | - |
| Minimum duration | None | 80 ms |
| Maximum duration | 120 s | 20 minutes |
| Maximum size | 256 MB | 256 MB |
| Formats | WAV (`audio/wav`) or raw PCM S16LE (`audio/pcm`) | WAV, raw PCM, AAC (`audio/aac`), MP3 (`audio/mpeg`), M4A (`audio/mp4`), Ogg/Opus (`audio/ogg`), FLAC (`audio/flac`), or WebM (`audio/webm`) |
| Sample width (WAV and PCM) | 16-bit only | 16-bit only |

Set the `audio` part's Content-Type to match the format you send.
`/v1/transcribe/live` decodes audio as it arrives, and compressed formats cannot
be decoded incrementally, so it rejects them with `415`. Send compressed audio
to `/v1/transcribe`, or decode it to WAV or raw PCM first.

## 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 [Achieve lowest latency](https://assemblyai.com/docs/dictation/uploading-while-recording.md).

## 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](https://assemblyai.com/docs/dictation/error-handling.md) for the full table.

For a recording longer than 120 seconds, wait until it finishes and post it to
`/v1/transcribe`. If you can't tell in advance how long the user will talk,
start on `/v1/transcribe/live` and fall back when it answers `413`; see
[Dictations up to 20 minutes](https://assemblyai.com/docs/dictation/recordings-over-two-minutes.md). For audio longer than 20 minutes, use
[Pre-recorded STT](https://assemblyai.com/docs/pre-recorded-audio/getting-started/transcribe-an-audio-file.md).
For a live transcript while the speaker is still talking, use
[Real-time STT](https://assemblyai.com/docs/streaming/getting-started/transcribe-streaming-audio.md).
