WavPack
37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0WavPack 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.
Encoding
Section titled “Encoding”Defaults are lossless, so for archiving just run it:
wavpack input.wav -o output.wvwvunpack output.wv -o restored.wavFor smaller files at the cost of speed:
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 for the full list.
Hybrid mode
Section titled “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.
# lossy .wv only, targeting 256 kbit/swavpack -b256 input.wav -o lossy.wv
# lossy .wv plus a .wvc correction file that makes it lossless, at 4 bits per samplewavpack -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
Section titled “FFmpeg”FFmpeg has its own WavPack encoder and decoder:
ffmpeg -i input.flac -c:a wavpack output.wvThe 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
Section titled “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);
wvtagedits tags andwvgaincalculates ReplayGain.
For web or general distribution, keep the WavPack archive and deliver FLAC or a lossy codec.