WavPack: Difference between revisions
Porcuswiki (talk | contribs) (Undo revision 35446 by Porcuswiki (talk)) |
Porcuswiki (talk | contribs) (Big general rewrite, based on draft https://wiki.hydrogenaud.io/index.php?title=WavPack&oldid=35446 (that nobody objected to) and further extensive fact-checking. Still missing a lot!) |
||
Line 5: | Line 5: | ||
| caption = Hybrid Lossless Audio Compression | | caption = Hybrid Lossless Audio Compression | ||
| maintainer = David Bryant | | maintainer = David Bryant | ||
| stable_release = 5. | | stable_release = 5.4.0 (2021-01-21) | ||
| preview_release = None | | preview_release = None | ||
| operating_system = Windows, | | operating_system = Windows, MacOSX, Linux/BSD/Unix, ... | ||
| use = Encoder/Decoder | | use = Encoder/Decoder | ||
| license = BSD license | | license = BSD license | ||
Line 13: | Line 13: | ||
}} | }} | ||
'''WavPack''' is a | '''WavPack''' (pronounced "wave-pack") is a [[lossless]] audio [[codec]], also offering optionally a [[hybrid codec| hybrid lossless/lossy]] mode. It is distributed as a free open-source encoder/decoder with a library and a large number of tools, including a Windows GUI and a range of plugins for both audio players and other software. Third party implementations are available, including ffmpeg. WavPack supports and/or can be played back on a large number of platforms/OSes including mobile (Android, iOS), portable ([[Rockbox]]) and even web apps. | ||
WavPack is arguably the most feature-rich lossless compressor, supporting a unique range of audio signals including [https://en.wikipedia.org/wiki/Direct_Stream_Digital Direct-Stream Digital]. While many special features might require the user to apply the WavPack executable directly (which may be achieved with drag+drop, see the ''Using WavPack'' section below), everyday use is supported by a wide range of players and taggers. | |||
WavPack | |||
WavPack | Performance-wise, WavPack defaults to a fast codec - compressing around [[FLAC]]'s default size, albeit not decoding as ultra-light. The user might fine-tune performance through a wide range of options, but all will ''decode'' faster than the high-compression [[Monkey's Audio]]/[[OptimFROG]] codecs. In a major lossless comparison test, only [[TAK]] could outperform WavPack on both compression and encoding speed and decoding speed.<ref>[http://audiograaf.nl/downloads.html Martijn van Beurden's comprehensive lossless comparison.] All comparisons taken from version 4 (WavPack version 4.70.0.)</ref> | ||
WavPack has inspired other codecs<ref>Monkey's Audio FAQ {{webarchive|http://web.archive.org/web/20001017210206/http://www.monkeysaudio.com/faq.html|2000-10-17}}</ref> and their features<ref>[http://losslessaudio.org/DualStream.php OptimFROG's "DualStream"] hybrid encoding</ref>. For more on WavPack, including on its history and technology, see the [https://en.wikipedia.org/wiki/WavPack Wikipedia entry]. | |||
= | = Features = | ||
For an end-user considering WavPack as a an audio format, its feature-richness might be the big selling point. WavPack supports pretty much all the more common features noted at [[Lossless_comparison| HA Wiki's Lossless Codec Comparison]] as in the following first list, but several users might consider the more unique features listed under the subsequent headline. | |||
* Seekable and streaming playback. | |||
* Error handling: upon playback, it will detect and report corrupted frames, mute to protect against static/noise output, and continue playback. Since version 5, WavPack can also check for corruption without decoding, hence quicker than any decoding format. Optional MD5 audio checksum can also be added upon encoding for file fingerprinting. | |||
* High-resolution audio support: any sampling rate that the WAVE format supports (4 GiHz), up to 32 bits per channel, including 32-bit floating-point (see below). | |||
* Multichannel support, currently limited at 256 channels, supports [https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible WAVEFORMATEXTENSIBLE] channel masks. | |||
* Piping support for encoding, and support for RAW PCM input. | |||
* RIFF chunks supported for recreating also ''non-audio'' chunks of the original files; by default, WavPack will restore to a file bit-identical to the original. | |||
* Tagging: APEv2. (ID3v1 is possible, but not advisable.) | |||
* Cuesheet support. In practice, some applications handle ''embedded'' cuesheets better in WavPack than in some other formats. | |||
* Unicode support. | |||
* Can be used in the [[Matroska]] container. | |||
* Windows GUI available. | |||
WavPack also handles bit depths not divisible by 8, and is known to employ a "wasted bits" strategy: For, say, a 20 bit signal in a 24 bit container, WavPack will detect that bits 21 to 24 are "wasted" and compressed as 20-bits without size penalty. | |||
WavPack | == Special/unique features == | ||
Most of these features are shared with a very few if any notable codecs, or extend to file types others do not support. In particular, WavPack seems to support every input signal that any other end-user codec does, and in nearly every (uncompressed) file type those also can read or write to (exception: FLAC's support for AIFF). | |||
* DSD support: can losslessly compress Philips DSDIFF and Sony DSF files (see "Using WavPack" below); can import ID3v2.3 tags from DSF. | |||
* 32-bit floating-point support. Also handles CoolEdit/Adobe Audition's 32-bit float format (use the -a option only if the .wav was generated by CoolEdit/Audition). (Like OptimFROG.) | |||
* Hybrid lossy/lossless mode (can also be used as lossy). (Like OptimFROG.) | |||
* Can create self-extracting (.sfx) files for Windows. (Like OptimFROG.) | |||
* Can in addition to PCM in WAVE files also read and output to RF64, Sony's Wave64, and CAF (including > 4 GB files). Also, WavPack will upon decoding recreate any (standards-compliant) file bit by bit including non-audio parts, to whatever input format it supports. (Monkey's/OptimFROG/TAK do the same, but support fewer formats.) | |||
* Recompression: Can recompress .wv files in place. (Like FLAC on .flac files.) | |||
* Drag and drop support: Dropping a file on to wavpack.exe/wvunpack.exe will encode/decode it (using default settings, to source directory). (Like FLAC.) | |||
WavPack 4 | == Limitations == | ||
* Despite being available for several platforms, PCM in AIFF is currently not supported. However, both endianness CAF files are. | |||
* Although output can be forced to various filetypes, there seems not to be an easy way to force output to a given version of the WAVE format. | |||
* DSD: Will reject DST-compressed DSD (which are already compressed heavier than WavPack does); can currently not import ID3v2.4, only ID3v2.3 (use [[Mp3tag]] to copy tags). | |||
* WavPack files created by 3.x and earlier need WavPack 4.x (still available!) or lower to decode. To recompress these files - if any are still around, WavPack 4 was released in 2004 - to WavPack 5 files which supports decoding-free error checking, one must first recompress to 4.x and then recompress by 5.x. | |||
* WavPack 5.4.0 drops Windows XP support. Versions up to 5.3.0 (released April 2020, still available) support XP. | |||
WavPack | WavPack has traditionally had less hardware support than FLAC ([[Rockbox]] having been the most notable platform, others listed at https://www.wavpack.com/index.html#Hardware ), but with WavPack playback through Android and iOS players, the distinction between "hardware" and "software" is arguably blurred. | ||
== | |||
=== Players == | = Using WavPack = | ||
WavPack files can be played back in supported players (see below), and several of these can encode to WavPack. However, frequently one must use the WavPack binaries to access certain of its features. For example, you cannot count on RIFF support by encoding through players which often deliver only the audio to the encoder - and you cannot count on such players to restore non-audio data faithfully. Also, the input format might exceed the player's internal decoding; e.g. trying to convert 32-bit integer or DSD with foobar2000 will yield a warning that it will not be lossless (also, converting DSD to PCM leads to files many times the size). | |||
The simplest encoding/decoding might be ''dragging and dropping'' a (supported) file to wavpack.exe (/wvunpack.exe). Then the file will be encoded/decoded with the default options. Dropping a .wv file onto wavpack.exe will recompress it, prompting before overwrite (again, using default settings - possibly a bad deal if it was encoded with high -x switches). Drag and drop works with single files only (but works on a shortcut to the executable). | |||
The rich set of options means that wavpack encoder and the wvunpack decoder (and wvtag/wvgain) have to "re-use letters"; while some do the same in the wvunpack and wavpack commands (like <tt>-d</tt> for delete input file, <tt>-y</tt> for "yes to all" and <tt>-l</tt> for "run with low priority" (Windows only)) and others cover the same purpose in both executables (like <tt>-m</tt> and <tt>-v</tt>), the user must be aware that there are letters used for completely unrelated functions in wvunpack as in wvpack (like <tt>-b</tt>, <tt>-c</tt>, <tt>-r</tt>). | |||
Options can be concatenated like for example writing <tt>-hh -x2 -m -v -y</tt> as <tt>-hhx2mvy</tt>. | |||
== Encoding == | |||
For fine-tuned performance, one might want to use the command-line encoder (or, the Windows GUI) rather than drag and drop. | |||
The basic encoding usage is <tt>wavpack filename.extension</tt> (which creates <tt>filename.wv</tt>) - this is what drag and drop accomplishes. One can specify output like e.g. <tt>wavpack infilename.wav outfilename.wv</tt>. Input file extension ".wav" can be dropped, and output ".wv" extension as well - but <tt>wavpack foo</tt> will only find foo.wav, not e.g. foo.w64. | |||
The manual (online, or included as wavpack_doc.html in the distribution) gives an exhaustive reference, and the following is merely a selection. Encoding using -hxm seems a sensible trade-off between compression and CPU load. | |||
* Compression. WavPack has four compression modes that affect compression as well as encoding ''and'' decoding time: fast (<tt>-f</tt>), default (no switch), high (<tt>-h</tt>) and very high (<tt>-hh</tt>). The WavPack manual warns against <tt>-hh</tt>for portable use due to its CPU-intensive decoding, which in van Beurden's comparison test amounts to twice the CPU load of <tt>-f</tt>, but still less than any Monkey's. On top these modes, the optional extra processing <tt>-x1</tt> to <tt>-x6</tt> settings will apply extra compression effort that does not affect ''decoding'' CPU load. <tt>-x</tt> without number is synonymous to <tt>-x1</tt>, which is often recommended (in all modes, fast/normal/high/extra high). The official manual calls <tt>-x4</tt> to <tt>-x6</tt> "extremely slow". | |||
With DSD files, there are only two compression settings, normal (selected by <tt>-f</tt> or no switch) and high (selected by <tt>-h</tt> or <tt>-hh</tt>), and the <tt>-x</tt> switches are silently ignored. | |||
* Guarding against errors upon encoding: The "<tt>-m</tt>" switch will compute an audio MD5 sum (like FLAC does by default) and store it for later verification. The "<tt>-v</tt>" switch will verify by decoding the file after encoding and writing the file to disk<ref>[https://hydrogenaud.io/index.php?topic=121714.msg1008108#msg1008108 HA forum comment:] verification checks the written file after closing and reopening</ref>. <tt>-mv</tt> will do both. (Using the corresponding switches in wvunpack will check without producing output file, however wvunpack also has a faster corruption check switch <tt>-vv</tt> for WavPack 5-encoded files.) | |||
* <tt>--import-id3</tt> will import ID3v2.3 tags (currently not v2.4) present in the source file - typically in Sony DSF files - and convert them to WavPack's preferred APE tags. (This does not affect the chunk stored for restoring the original file.) By default, this is limited to 1 MB; for more, use <tt>--allow-huge-tags</tt>. Same option works in wvtag. | |||
* <tt>-r</tt>: remove extra (non-audio) chunks. By default, WavPack will store these in the .wv file for later bit-by-bit restoration of everything, not only the audio. To throw them away - like encoding through most players appear to do - use this setting. | |||
* <tt>--pause</tt>: (Windows only!) waits for keypress at the end. Useful for reading output before exit when calling wavpack/wvunpack in a separate window (which the Windows front-end does). | |||
* <tt>-y</tt>: "yes" to everything. Use with caution, will overwrite. | |||
* <tt>-d</tt>: delete source file upon successful completion. Again, use with caution. | |||
* <tt>-l</tt> will force WavPack to run at low priority (Windows only) | |||
* <tt>-c</tt> with <tt>-b</tt> to select quality: Create correction file for hybrid use. | |||
WavPack can recompress .wv files in place (using a temporary file until done). For example, <tt>wavpack -hx4mvly wavpackfile.wv</tt> will recompress wavpackfile.wv the file in high mode, using <tt>-x4</tt> extra processing, with low priority (assuming the Windows platform), write audio MD5 to it, open the temp file and re-read for verification - and once verified, replace the old wavpackfile.wv. | |||
=== Encoding using WavPack hybrid === | |||
(Needs to be added by someone who knows the details. DSD can currently not be hybrid-encoded.) | |||
== Decoding == | |||
{stub-subsection, incomplete} | |||
Basic decoding usage - as will be accomplished by drag and drop - is wvunpack filename.wv. If encoded from file, the default operation is to restore the exactly same file, with suffix as appropriate: filename.wav / filename.w64 / filename.caf. (Though WavPack then knows the original input format, it does not store the original file name.) If only audio was encoded (from a player, pipe or <tt>-r</tt>), output defaults to filename.wav. | |||
Again, file extensions can be dropped; e.g., using <tt>wvunpack foo bar</tt> will decode foo.wv to bar.wav/bar.w64/bar.caf, extension chosen from original format. Assigning an output extension - like bar.w64 - will override input format. | |||
=== How to encode from / decode to AIFF === | |||
FFmpeg can encode/decode to/from WavPack, but with limitations and potential information loss; for example, WAVE/AIFF output will default to 16-bits (potentially lossy), and anything else must be specified. Also, upon encoding a 20-bit file, ffmpeg will be upconverted to 24 bit .wv, deleting the information that it was ever 20-bits. To avoid this: | |||
* To encode AIFF, convert it first to .wav in a way that keeps the bit depth. FLAC is the lossless encoder that accepts AIFF in, and will preserve bit depth. (It is restricted to 4-24 bits.) | |||
* To decode to AIFF: <tt>wvunpack "infile.wv" --caf-be - | ffmpeg -i - -codec copy "outfile.aiff"</tt> will preserve bit depth. | |||
(Also, no riff chunks are available through ffmpeg - although for AIFF that is not an issue anyway, as WavPack cannot store AIFF metadata.) | |||
=== Splitting WavPack files by cuesheet === | |||
wvunpack cannot split WavPack files by neither embedded nor external cuesheet, but some external applications can (and will have to decode/re-encode): [[CUETools]] can if it is CDDA (44.1 kHz 16-bit stereo), and can re-encode back to WavPack. refalac can decode split by cuesheets with the appropriate DLL files<ref>[https://github.com/nu774/qaac/wiki/refalac-usage refalac usage] includes how to split by cuesheet</ref>, outputting WAVE or ALAC-in-MP4. | |||
== Other file handling == | |||
{stub-subsections, incomplete} | |||
=== Error checking and other file info === | |||
To get information about WavPack files without decoding to file, use wvunpack. For use with the Windows front-end, the --pause switch is essential to read the output. | |||
* <tt>--pause</tt>: (Windows only!) waits for keypress at the end. | |||
* <tt>-vv</tt>: Quick verify without decoding (WavPack 5 files only). This functionality seems to be unavailable outside the official wvunpack (other applications which verify will fall back to the next item, -v): | |||
* <tt>-v</tt>: Verify (will decode to check that everything is OK - but not write any file). | |||
* <tt>-s</tt>/<tt>-ss</tt>: <tt>-s</tt> displays summary of the file, <tt>-ss</tt> a long summary including tags | |||
* <tt>-x</tt> FIELD: Shows tag, e.g. <tt> -x comment </tt> shows the <comment> field. Also <tt> wvtag -x </tt> does the same thing. | |||
* <tt>-c</tt>: Like <tt> -x cuesheet</tt>. Also <tt> wvtag -c </tt> does the same thing. | |||
=== Tagging (wvtag) and replaygain management (wvgain) === | |||
("Needs" to be added. There seems not to be anything here that HA's fave taggers/player cannot handle?) | |||
= Software support = | |||
With Android support and playback through ffmpeg, it might no longer be feasible to maintain a list of applications that can play WavPack files, and the following is most certainly incomplete - as is the list at https://www.wavpack.com/#Software . | |||
== Players == | |||
* [[foobar2000]] advanced freeware audio player plays/decodes WavPack out of the box on both Windows, MacOS, Android and iOS (Windows: supports encoding if wavpack.exe is installed, and redistributes the official wavpack.exe through its "Free encoder pack" addon for encoding. With ReplayGain & cuesheets support.) Also [[Boom]] from the same author. | |||
* [http://www.videolan.org/vlc/download-windows.html VLC] multiplatform media player | |||
* [http://www.vuplayer.com/vuplayer.php VUPlayer] (official plugin, supports encoding) | |||
* NullSoft [[Winamp]] (plugin with ReplayGain & Media Library support) and Winamp-compatible players | * NullSoft [[Winamp]] (plugin with ReplayGain & Media Library support) and Winamp-compatible players | ||
* [[Windows Media Player]] and other directshow-based players (MPC, TCMP, RadLight) (with [http://www.hydrogenaudio.org/forums/index.php?showtopic=103693 CoreWavPack] directshow filter) | * [[Windows Media Player]] and other directshow-based players (MPC, TCMP, RadLight) (with [http://www.hydrogenaudio.org/forums/index.php?showtopic=103693 CoreWavPack] directshow filter) | ||
* [http://cogosx.sourceforge.net/ Cog] Audio player for MacOS X. | * [http://cogosx.sourceforge.net/ Cog] Audio player for MacOS X. | ||
* [https://wiki.jriver.com/index.php/WavPack JRiver Media Center] | |||
* [[XMMS]] (with Kuniklo's plugin) | * [[XMMS]] (with Kuniklo's plugin) | ||
* [http://fondriest.frederic.free.fr/realisations/lamip/ LAMIP] (official plugin) | * [http://fondriest.frederic.free.fr/realisations/lamip/ LAMIP] (official plugin) | ||
* [http://mpxplay.sourceforge.net/ MPXplay] for DOS! | * [http://mpxplay.sourceforge.net/ MPXplay] for DOS! | ||
* [http://aqualung.sourceforge.net/ Aqualung] for GNU/Linux | * [http://aqualung.sourceforge.net/ Aqualung] for GNU/Linux | ||
* Cowon [http://www.jetaudio.com/ JetAudio Player] and CD ripper | |||
* Cowon [http://www.jetaudio.com/ JetAudio Player] | * [http://www.un4seen.com/ XMPlay] Plugin required (WavPack input plugin) and (bass library) to play 'wv' files | ||
*[http://www.un4seen.com/ XMPlay] Plugin required (WavPack input plugin) and (bass library) to play 'wv' files | |||
== | == Converters, CD rippers etc. == | ||
Several of the ''players'', like Cowon JetAudio, foobar2000 and VUplayer, also have converters that can create WavPack files. More: | |||
* Custom Windows [http://www.wavpack.com/WavPack_frontend.zip WavPack frontend] (by Speekenbrink) | * Custom Windows [http://www.wavpack.com/WavPack_frontend.zip WavPack frontend] (by Speekenbrink) | ||
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter CD ripper/writer / Audio Player / (official addon) | |||
* [[fre:ac fre:ac]] multi-platform CD ripper/converter | |||
* [[Exact Audio Copy]] CD Ripper ([[https://wiki.hydrogenaud.io/index.php?title=EAC_and_WavPack EAC and WavPack wiki guide]]) | |||
* [http://www.nero.com/eng/ Nero] | |||
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / | * [http://cdexos.sourceforge.net CDex] CD ripper | ||
* [http://www.easeaudioconverter.com/wavpack.htm Ease Audio Converter] (Shareware / NOT Freeware) | * [http://www.easeaudioconverter.com/wavpack.htm Ease Audio Converter] (Shareware / NOT Freeware) | ||
* [http://media.io/ Online Audio Converter] | * [http://media.io/ Media.io Online Audio Converter] | ||
* Konvertor [http://www.logipole.com/index.html Konvertor] | * Konvertor [http://www.logipole.com/index.html Konvertor] | ||
* [http://cuetools.net CUETools] converter and AccurateRip/CTDB checker | |||
* [https://github.com/nu774/qaac refalac] | |||
== Taggers == | |||
* [http://www.mp3tag.de/en/index.html Mp3tag] Universal Tag Editor | * [http://www.mp3tag.de/en/index.html Mp3tag] Universal Tag Editor | ||
* [https://picard.musicbrainz.org/ MusicBrainz Picard] Tagger with audio identification | |||
* [http://www.jtclipper.eu/thegodfather/ The GodFather] Tagger / Music manager | * [http://www.jtclipper.eu/thegodfather/ The GodFather] Tagger / Music manager | ||
* [[Tag.exe|Case's Tag]] command line tagger | * [[Tag.exe|Case's Tag]] command line tagger | ||
== Other tools == | |||
* [[Adobe Audition]] and Cool Edit (filter with 32-bit floats & extra info save support) | |||
* [http://mr-questionman.en.uptodown.com/windows Mr. QuestionMan] | * [http://mr-questionman.en.uptodown.com/windows Mr. QuestionMan] | ||
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] – tool to multiplex WavPack streams inside the Matroska container | * [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] – tool to multiplex WavPack streams inside the Matroska container | ||
''It's worth mentioning the [[Matroska]] guys decided to concentrate on WavPack as the lossless compressor of choice for their container. Quite an honor... :-)'' | ''It's worth mentioning the [[Matroska]] guys decided to concentrate on WavPack as the lossless compressor of choice for their container. Quite an honor... :-)'' | ||
* [https://support.pkware.com/display/PKSZLU/PKZIP+Toolkit+for+Windows PKWare]'s .zip format compresses audio by WavPack since version 6.3.2 (2007). Beware that there is no expectation that other decompression software handles these zip files; even if PKWare co-designed the format and PKZip was the original .zip implementation, their subsequent compression methods are outside the ISO/IEC standardized zip format specification. | |||
= | = Links = | ||
* [http://www.wavpack.com/ Official website] | * [http://www.wavpack.com/ Official website] | ||
* [http://www.rarewares.org/lossless.html Unofficial multiplatform versions] at RareWares | * [https://github.com/dbry/WavPack Github repository] | ||
* [[Lossless_comparison|Lossless Codec Comparison]] | * [http://www.rarewares.org/lossless.html Unofficial 4.32 multiplatform versions] at RareWares | ||
* [https://en.wikipedia.org/wiki/WavPack WavPack at Wikipedia] | |||
* [https://wiki.multimedia.cx/index.php/WavPack WavPack at Multimediawiki] (not updated with version 5) | |||
* [[Lossless_comparison| HA Wiki's Lossless Codec Comparison]] originally by [[User:Rjamorim|Rjamorim]] | |||
* An older (2005) performance comparison of lossless audio compressors {{webarchive|https://web.archive.org/web/20151027213336/http://members.home.nl/w.speek/comparison.htm|2015-10-27}} by Speek, using WavPack version 4.0 | |||
* [[EAC_and_WavPack | Configuring EAC and WavPack]] | * [[EAC_and_WavPack | Configuring EAC and WavPack]] | ||
<references/> | |||
[[Category:Codecs]] | [[Category:Codecs]] | ||
[[Category:Lossless]] | [[Category:Lossless]] |
Revision as of 18:40, 14 February 2022
Developer(s) | David Bryant |
Release information | |
Stable release | 5.4.0 (2021-01-21) |
Preview release | None |
Compatibility | |
Operating system | Windows, MacOSX, Linux/BSD/Unix, ... |
Additional information | |
Use | Encoder/Decoder |
License | BSD license |
Website | http://www.wavpack.com/ |
WavPack (pronounced "wave-pack") is a lossless audio codec, also offering optionally a hybrid lossless/lossy mode. It is distributed as a free open-source encoder/decoder with a library and a large number of tools, including a Windows GUI and a range of plugins for both audio players and other software. Third party implementations are available, including ffmpeg. WavPack supports and/or can be played back on a large number of platforms/OSes including mobile (Android, iOS), portable (Rockbox) and even web apps.
WavPack is arguably the most feature-rich lossless compressor, supporting a unique range of audio signals including Direct-Stream Digital. While many special features might require the user to apply the WavPack executable directly (which may be achieved with drag+drop, see the Using WavPack section below), everyday use is supported by a wide range of players and taggers.
Performance-wise, WavPack defaults to a fast codec - compressing around FLAC's default size, albeit not decoding as ultra-light. The user might fine-tune performance through a wide range of options, but all will decode faster than the high-compression Monkey's Audio/OptimFROG codecs. In a major lossless comparison test, only TAK could outperform WavPack on both compression and encoding speed and decoding speed.[1]
WavPack has inspired other codecs[2] and their features[3]. For more on WavPack, including on its history and technology, see the Wikipedia entry.
Features
For an end-user considering WavPack as a an audio format, its feature-richness might be the big selling point. WavPack supports pretty much all the more common features noted at HA Wiki's Lossless Codec Comparison as in the following first list, but several users might consider the more unique features listed under the subsequent headline.
- Seekable and streaming playback.
- Error handling: upon playback, it will detect and report corrupted frames, mute to protect against static/noise output, and continue playback. Since version 5, WavPack can also check for corruption without decoding, hence quicker than any decoding format. Optional MD5 audio checksum can also be added upon encoding for file fingerprinting.
- High-resolution audio support: any sampling rate that the WAVE format supports (4 GiHz), up to 32 bits per channel, including 32-bit floating-point (see below).
- Multichannel support, currently limited at 256 channels, supports WAVEFORMATEXTENSIBLE channel masks.
- Piping support for encoding, and support for RAW PCM input.
- RIFF chunks supported for recreating also non-audio chunks of the original files; by default, WavPack will restore to a file bit-identical to the original.
- Tagging: APEv2. (ID3v1 is possible, but not advisable.)
- Cuesheet support. In practice, some applications handle embedded cuesheets better in WavPack than in some other formats.
- Unicode support.
- Can be used in the Matroska container.
- Windows GUI available.
WavPack also handles bit depths not divisible by 8, and is known to employ a "wasted bits" strategy: For, say, a 20 bit signal in a 24 bit container, WavPack will detect that bits 21 to 24 are "wasted" and compressed as 20-bits without size penalty.
Special/unique features
Most of these features are shared with a very few if any notable codecs, or extend to file types others do not support. In particular, WavPack seems to support every input signal that any other end-user codec does, and in nearly every (uncompressed) file type those also can read or write to (exception: FLAC's support for AIFF).
- DSD support: can losslessly compress Philips DSDIFF and Sony DSF files (see "Using WavPack" below); can import ID3v2.3 tags from DSF.
- 32-bit floating-point support. Also handles CoolEdit/Adobe Audition's 32-bit float format (use the -a option only if the .wav was generated by CoolEdit/Audition). (Like OptimFROG.)
- Hybrid lossy/lossless mode (can also be used as lossy). (Like OptimFROG.)
- Can create self-extracting (.sfx) files for Windows. (Like OptimFROG.)
- Can in addition to PCM in WAVE files also read and output to RF64, Sony's Wave64, and CAF (including > 4 GB files). Also, WavPack will upon decoding recreate any (standards-compliant) file bit by bit including non-audio parts, to whatever input format it supports. (Monkey's/OptimFROG/TAK do the same, but support fewer formats.)
- Recompression: Can recompress .wv files in place. (Like FLAC on .flac files.)
- Drag and drop support: Dropping a file on to wavpack.exe/wvunpack.exe will encode/decode it (using default settings, to source directory). (Like FLAC.)
Limitations
- Despite being available for several platforms, PCM in AIFF is currently not supported. However, both endianness CAF files are.
- Although output can be forced to various filetypes, there seems not to be an easy way to force output to a given version of the WAVE format.
- DSD: Will reject DST-compressed DSD (which are already compressed heavier than WavPack does); can currently not import ID3v2.4, only ID3v2.3 (use Mp3tag to copy tags).
- WavPack files created by 3.x and earlier need WavPack 4.x (still available!) or lower to decode. To recompress these files - if any are still around, WavPack 4 was released in 2004 - to WavPack 5 files which supports decoding-free error checking, one must first recompress to 4.x and then recompress by 5.x.
- WavPack 5.4.0 drops Windows XP support. Versions up to 5.3.0 (released April 2020, still available) support XP.
WavPack has traditionally had less hardware support than FLAC (Rockbox having been the most notable platform, others listed at https://www.wavpack.com/index.html#Hardware ), but with WavPack playback through Android and iOS players, the distinction between "hardware" and "software" is arguably blurred.
Using WavPack
WavPack files can be played back in supported players (see below), and several of these can encode to WavPack. However, frequently one must use the WavPack binaries to access certain of its features. For example, you cannot count on RIFF support by encoding through players which often deliver only the audio to the encoder - and you cannot count on such players to restore non-audio data faithfully. Also, the input format might exceed the player's internal decoding; e.g. trying to convert 32-bit integer or DSD with foobar2000 will yield a warning that it will not be lossless (also, converting DSD to PCM leads to files many times the size).
The simplest encoding/decoding might be dragging and dropping a (supported) file to wavpack.exe (/wvunpack.exe). Then the file will be encoded/decoded with the default options. Dropping a .wv file onto wavpack.exe will recompress it, prompting before overwrite (again, using default settings - possibly a bad deal if it was encoded with high -x switches). Drag and drop works with single files only (but works on a shortcut to the executable).
The rich set of options means that wavpack encoder and the wvunpack decoder (and wvtag/wvgain) have to "re-use letters"; while some do the same in the wvunpack and wavpack commands (like -d for delete input file, -y for "yes to all" and -l for "run with low priority" (Windows only)) and others cover the same purpose in both executables (like -m and -v), the user must be aware that there are letters used for completely unrelated functions in wvunpack as in wvpack (like -b, -c, -r).
Options can be concatenated like for example writing -hh -x2 -m -v -y as -hhx2mvy.
Encoding
For fine-tuned performance, one might want to use the command-line encoder (or, the Windows GUI) rather than drag and drop.
The basic encoding usage is wavpack filename.extension (which creates filename.wv) - this is what drag and drop accomplishes. One can specify output like e.g. wavpack infilename.wav outfilename.wv. Input file extension ".wav" can be dropped, and output ".wv" extension as well - but wavpack foo will only find foo.wav, not e.g. foo.w64. The manual (online, or included as wavpack_doc.html in the distribution) gives an exhaustive reference, and the following is merely a selection. Encoding using -hxm seems a sensible trade-off between compression and CPU load.
- Compression. WavPack has four compression modes that affect compression as well as encoding and decoding time: fast (-f), default (no switch), high (-h) and very high (-hh). The WavPack manual warns against -hhfor portable use due to its CPU-intensive decoding, which in van Beurden's comparison test amounts to twice the CPU load of -f, but still less than any Monkey's. On top these modes, the optional extra processing -x1 to -x6 settings will apply extra compression effort that does not affect decoding CPU load. -x without number is synonymous to -x1, which is often recommended (in all modes, fast/normal/high/extra high). The official manual calls -x4 to -x6 "extremely slow".
With DSD files, there are only two compression settings, normal (selected by -f or no switch) and high (selected by -h or -hh), and the -x switches are silently ignored.
- Guarding against errors upon encoding: The "-m" switch will compute an audio MD5 sum (like FLAC does by default) and store it for later verification. The "-v" switch will verify by decoding the file after encoding and writing the file to disk[4]. -mv will do both. (Using the corresponding switches in wvunpack will check without producing output file, however wvunpack also has a faster corruption check switch -vv for WavPack 5-encoded files.)
- --import-id3 will import ID3v2.3 tags (currently not v2.4) present in the source file - typically in Sony DSF files - and convert them to WavPack's preferred APE tags. (This does not affect the chunk stored for restoring the original file.) By default, this is limited to 1 MB; for more, use --allow-huge-tags. Same option works in wvtag.
- -r: remove extra (non-audio) chunks. By default, WavPack will store these in the .wv file for later bit-by-bit restoration of everything, not only the audio. To throw them away - like encoding through most players appear to do - use this setting.
- --pause: (Windows only!) waits for keypress at the end. Useful for reading output before exit when calling wavpack/wvunpack in a separate window (which the Windows front-end does).
- -y: "yes" to everything. Use with caution, will overwrite.
- -d: delete source file upon successful completion. Again, use with caution.
- -l will force WavPack to run at low priority (Windows only)
- -c with -b to select quality: Create correction file for hybrid use.
WavPack can recompress .wv files in place (using a temporary file until done). For example, wavpack -hx4mvly wavpackfile.wv will recompress wavpackfile.wv the file in high mode, using -x4 extra processing, with low priority (assuming the Windows platform), write audio MD5 to it, open the temp file and re-read for verification - and once verified, replace the old wavpackfile.wv.
Encoding using WavPack hybrid
(Needs to be added by someone who knows the details. DSD can currently not be hybrid-encoded.)
Decoding
{stub-subsection, incomplete}
Basic decoding usage - as will be accomplished by drag and drop - is wvunpack filename.wv. If encoded from file, the default operation is to restore the exactly same file, with suffix as appropriate: filename.wav / filename.w64 / filename.caf. (Though WavPack then knows the original input format, it does not store the original file name.) If only audio was encoded (from a player, pipe or -r), output defaults to filename.wav.
Again, file extensions can be dropped; e.g., using wvunpack foo bar will decode foo.wv to bar.wav/bar.w64/bar.caf, extension chosen from original format. Assigning an output extension - like bar.w64 - will override input format.
How to encode from / decode to AIFF
FFmpeg can encode/decode to/from WavPack, but with limitations and potential information loss; for example, WAVE/AIFF output will default to 16-bits (potentially lossy), and anything else must be specified. Also, upon encoding a 20-bit file, ffmpeg will be upconverted to 24 bit .wv, deleting the information that it was ever 20-bits. To avoid this:
- To encode AIFF, convert it first to .wav in a way that keeps the bit depth. FLAC is the lossless encoder that accepts AIFF in, and will preserve bit depth. (It is restricted to 4-24 bits.)
- To decode to AIFF: wvunpack "infile.wv" --caf-be - | ffmpeg -i - -codec copy "outfile.aiff" will preserve bit depth.
(Also, no riff chunks are available through ffmpeg - although for AIFF that is not an issue anyway, as WavPack cannot store AIFF metadata.)
Splitting WavPack files by cuesheet
wvunpack cannot split WavPack files by neither embedded nor external cuesheet, but some external applications can (and will have to decode/re-encode): CUETools can if it is CDDA (44.1 kHz 16-bit stereo), and can re-encode back to WavPack. refalac can decode split by cuesheets with the appropriate DLL files[5], outputting WAVE or ALAC-in-MP4.
Other file handling
{stub-subsections, incomplete}
Error checking and other file info
To get information about WavPack files without decoding to file, use wvunpack. For use with the Windows front-end, the --pause switch is essential to read the output.
- --pause: (Windows only!) waits for keypress at the end.
- -vv: Quick verify without decoding (WavPack 5 files only). This functionality seems to be unavailable outside the official wvunpack (other applications which verify will fall back to the next item, -v):
- -v: Verify (will decode to check that everything is OK - but not write any file).
- -s/-ss: -s displays summary of the file, -ss a long summary including tags
- -x FIELD: Shows tag, e.g. -x comment shows the <comment> field. Also wvtag -x does the same thing.
- -c: Like -x cuesheet. Also wvtag -c does the same thing.
Tagging (wvtag) and replaygain management (wvgain)
("Needs" to be added. There seems not to be anything here that HA's fave taggers/player cannot handle?)
Software support
With Android support and playback through ffmpeg, it might no longer be feasible to maintain a list of applications that can play WavPack files, and the following is most certainly incomplete - as is the list at https://www.wavpack.com/#Software .
Players
- foobar2000 advanced freeware audio player plays/decodes WavPack out of the box on both Windows, MacOS, Android and iOS (Windows: supports encoding if wavpack.exe is installed, and redistributes the official wavpack.exe through its "Free encoder pack" addon for encoding. With ReplayGain & cuesheets support.) Also Boom from the same author.
- VLC multiplatform media player
- VUPlayer (official plugin, supports encoding)
- NullSoft Winamp (plugin with ReplayGain & Media Library support) and Winamp-compatible players
- Windows Media Player and other directshow-based players (MPC, TCMP, RadLight) (with CoreWavPack directshow filter)
- Cog Audio player for MacOS X.
- JRiver Media Center
- XMMS (with Kuniklo's plugin)
- LAMIP (official plugin)
- MPXplay for DOS!
- Aqualung for GNU/Linux
- Cowon JetAudio Player and CD ripper
- XMPlay Plugin required (WavPack input plugin) and (bass library) to play 'wv' files
Converters, CD rippers etc.
Several of the players, like Cowon JetAudio, foobar2000 and VUplayer, also have converters that can create WavPack files. More:
- Custom Windows WavPack frontend (by Speekenbrink)
- dBpowerAMP Music Converter CD ripper/writer / Audio Player / (official addon)
- fre:ac fre:ac multi-platform CD ripper/converter
- Exact Audio Copy CD Ripper ([EAC and WavPack wiki guide])
- Nero
- CDex CD ripper
- Ease Audio Converter (Shareware / NOT Freeware)
- Media.io Online Audio Converter
- Konvertor Konvertor
- CUETools converter and AccurateRip/CTDB checker
- refalac
Taggers
- Mp3tag Universal Tag Editor
- MusicBrainz Picard Tagger with audio identification
- The GodFather Tagger / Music manager
- Case's Tag command line tagger
Other tools
- Adobe Audition and Cool Edit (filter with 32-bit floats & extra info save support)
- Mr. QuestionMan
- mkvtoolnix – tool to multiplex WavPack streams inside the Matroska container
It's worth mentioning the Matroska guys decided to concentrate on WavPack as the lossless compressor of choice for their container. Quite an honor... :-)
- PKWare's .zip format compresses audio by WavPack since version 6.3.2 (2007). Beware that there is no expectation that other decompression software handles these zip files; even if PKWare co-designed the format and PKZip was the original .zip implementation, their subsequent compression methods are outside the ISO/IEC standardized zip format specification.
Links
- Official website
- Github repository
- Unofficial 4.32 multiplatform versions at RareWares
- WavPack at Wikipedia
- WavPack at Multimediawiki (not updated with version 5)
- HA Wiki's Lossless Codec Comparison originally by Rjamorim
- An older (2005) performance comparison of lossless audio compressors (archived on October 27, 2015) by Speek, using WavPack version 4.0
- Configuring EAC and WavPack
- ↑ Martijn van Beurden's comprehensive lossless comparison. All comparisons taken from version 4 (WavPack version 4.70.0.)
- ↑ Monkey's Audio FAQ (archived on October 17, 2000)
- ↑ OptimFROG's "DualStream" hybrid encoding
- ↑ HA forum comment: verification checks the written file after closing and reopening
- ↑ refalac usage includes how to split by cuesheet