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

# coreav decode-audio

> Decode a FLAC or MP3 track of an MP4, MOV, Matroska or WebM file to WAV.

`coreav decode-audio INPUT OUTPUT` decodes an audio track of an MP4, MOV, Matroska or WebM file to a WAV file. It decodes FLAC and MP3. It can also resample (`--rate`), downmix (`--channels`) and change the sample format (`--format`). The summary is [`coreav.decode-audio/1`](https://github.com/coreav-dev/coreav/blob/main/docs/schema/decode-audio-v1.md).

## Examples

```sh theme={null}
coreav decode-audio input.mkv output.wav
coreav decode-audio --rate 16000 --channels 1 input.mp4 speech.wav
```

The second example writes 16 kHz mono, a common input format for speech recognition.

## Options

```text theme={null}
Decode an audio track of an MP4/MOV, Matroska or WebM file to a WAV file (FLAC, MP3)

Usage: coreav decode-audio [OPTIONS] <INPUT> <OUTPUT>

Arguments:
  <INPUT>   The file to read
  <OUTPUT>  Where to write the WAV file: a new file, or `-` for standard output

Options:
      --stream <STREAM>  The audio stream index (default: the first audio stream whose codec CoreAV decodes)
      --threads <N>      Threads that decode in parallel; 0 for one per CPU, at most 16 [default: 0]
      --format <FORMAT>  Sample format of the output: `s16` (16-bit integers, as ffmpeg writes WAV by default), `s24`, `s32` or `f32` (32-bit float) [default: s16] [possible values: s16, s24, s32, f32]
      --rate <HZ>        Sample rate of the output in Hz, 1000 to 768000 (default: the stream's), for example 16000 for speech recognition. Another rate is resampled
      --channels <N>     Channels of the output (default: the stream's): 1 or 2 downmix other layouts (ITU-R BS.775); mono becomes stereo at -3 dB
      --force            Overwrite OUTPUT if it exists (a symbolic link is replaced, not written through; the new file keeps the old one's permissions)
  -h, --help             Print help
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.