Skip to content

WavPack

currentMigrated from docs/audio/WavPack.mdx at 37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0

WavPack is an open lossless audio codec by David Bryant, dating from 1998. It compresses about as well as 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.

Defaults are lossless, so for archiving just run it:

Terminal window
wavpack input.wav -o output.wv
wvunpack output.wv -o restored.wav

For smaller files at the cost of speed:

Terminal window
wavpack -hh -x4 -m input.wav -o output.wv
OptionEffect
-fFast: quicker encode and decode, larger files.
-h / -hhHigh and very high: better compression, slower to encode and decode.
-x0 … -x6Extra encoder-side search (default 1). Only costs encoding time. 4–6 build custom filters and are very slow.
-mStore an MD5 of the audio so wvunpack -v can check integrity.
-vVerify the file right after encoding (not possible with pipes).
--threads=nUp 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 for the full list.

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.

Terminal window
# 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 or 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 has its own WavPack encoder and decoder:

Terminal window
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.

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