# WavPack

Canonical URL: https://encode.wiki/codecs/audio/wavpack/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): a76ad99aab04332737ab3e82170dba9a5208a0284201fa76d83ef5cbd891fe01

WavPack is an open lossless audio codec by David Bryant, dating from 1998. It compresses about as well as [FLAC](/codecs/audio/flac/), with slower high-compression modes, handles integer PCM, 32-bit float and DSD, supports a very large number of channels, and has a hybrid mode that stores a lossy file plus a separate correction file. Player and hardware support is much narrower than FLAC's, which is why most people use FLAC. Choose WavPack when you need floating-point or DSD stored losslessly, or want the hybrid mode.

## Encoding

Defaults are lossless, so for archiving just run it:

```sh
wavpack input.wav -o output.wv
wvunpack output.wv -o restored.wav
```

For smaller files at the cost of speed:

```sh
wavpack -hh -x4 -m input.wav -o output.wv
```

| Option | Effect |
| --- | --- |
| `-f` | Fast: quicker encode and decode, larger files. |
| `-h` / `-hh` | High and very high: better compression, slower to encode and decode. |
| `-x0` … `-x6` | Extra encoder-side search (default 1). Only costs encoding time. 4–6 build custom filters and are very slow. |
| `-m` | Store an MD5 of the audio so `wvunpack -v` can check integrity. |
| `-v` | Verify the file right after encoding (not possible with pipes). |
| `--threads=n` | Up to 12 threads; on by default on multicore machines, but not used in hybrid mode except for multichannel files. |

`-h` and `-x` change effort and size, not fidelity. DSD input is always lossless and ignores `-x` and the hybrid options. Check the [WavPack manual](https://www.wavpack.com/wavpack_doc.html) for the full list.

## Hybrid mode

Hybrid mode writes a lossy `.wv` file. With `-c` it also writes a `.wvc` correction file; playing both gives the exact original, and the `.wv` alone plays as a lossy file.

```sh
# lossy .wv only, targeting 256 kbit/s
wavpack -b256 input.wav -o lossy.wv

# lossy .wv plus a .wvc correction file that makes it lossless, at 4 bits per sample
wavpack -b4 -c input.wav -o hybrid.wv
```

`-b` takes either a bitrate in kbit/s (24–9600) or, below 24, bits per sample (2.0–23.9). So `-b4` is four bits per sample, not 4 kbit/s. The floor of 2 bits per sample is about 200 kbit/s for CD stereo, which is high. WavPack's lossy mode has no psychoacoustic model, so [Opus](/codecs/audio/opus/) or [AAC](/codecs/audio/aac/) sound better at far lower rates. Hybrid is mainly useful if you want a portable lossy copy and a lossless archive from a single encode. `-cc` squeezes the pair further, at some cost to lossy quality and decode speed.

Always keep each `.wvc` next to its `.wv`.

## FFmpeg

FFmpeg has its own WavPack encoder and decoder:

```sh
ffmpeg -i input.flac -c:a wavpack output.wv
```

The encoder does lossless only, with no lossy or hybrid mode, and `-compression_level` (0–8) trades speed for size. The decoder ignores `.wvc` files, so a hybrid file plays as the lossy version. Use the native `wavpack` and `wvunpack` for anything hybrid or DSD.

## Compatibility

- Foobar2000, mpv, VLC and FFmpeg-based players handle ordinary WavPack. Browsers do not play it natively, and few hardware players do.
- Many players ignore hybrid correction files, DSD, or float WavPack.
- Matroska can hold lossless WavPack.
- Tagging uses APEv2 (or ID3v1); `wvtag` edits tags and `wvgain` calculates ReplayGain.

For web or general distribution, keep the WavPack archive and deliver FLAC or a lossy codec.
