Using WavPack Ver 3.97

WavPack consists of two complimentary executable programs, WavPack and WvUnpack. These programs allow you to compress (and restore) stereo and mono audio files in the .WAV format. The audio files must be simple PCM from 16 to 24 bits per sample. The programs are full 32-bit executables and therefore must only be used under Windows (for real DOS applications or with Windows 3.1 use WavPack 3.4 instead). They are initiated from the MS-DOS command line prompt with the following syntax:
Usage:   WAVPACK [-options] [@]infile[.wav]|- [[@]outfile[.wv]|outpath]

Options: -bn = enable hybrid compression, 'n' is kbits/second (kbps)
            (n = 24-4800) or bits/sample (n = 4-23); otherwise default
            operation is pure lossless compression
         -c  = create correction file (.wvc) for hybrid mode
         -d  = delete source file if successful (use with caution!)
         -e  = create self-extracting executable
            (WVSELFX.EXE must be in the same directory as WAVPACK.EXE)
         -f (or -ff) = fast (or very fast) lossless compression
         -jn = joint-stereo override (where applicable, 0=LR/1=MS)
         -h  = high quality (best compression in all modes, but slower)
         -n  = calculate average and peak quantization noise (hybrid only)
         -rn = raw mode for non-wav files (1=mono/2=stereo)
         -sn = noise shaping override (hybrid only, 0=off/1=1st order)
         -t  = copy input file's time stamp to output file
         -y  = yes to all warnings (use with caution!)

Usage:   WVUNPACK [-options] [@]infile[.wv] [[@]outfile[.wav]|outpath|-]

Options: -d  = delete source file if successful (use with caution!)
         -t  = copy input file's time stamp to output file
         -v  = verify source data only (no output file created)
         -y  = yes to overwrite warning (use with caution!)

Wildcards may be used in the input file specification if the output file spec is a valid destination path (or is not specified), and both programs will warn before overwriting any file. If a filename is preceeded with a '@', then that file will be processed as a file list. If a '-' is specified for the input file in WavPack (or the output file in WvUnpack), then stdin (or stdout) will be used instead of a file. The programs will display progress in percentage complete and when finished with each file will give the compression ratio, whether the compression was lossy or lossless, and the processing time. They will also display the progress percentage for the whole batch of files on the title bar which is useful when they are being run minimized.

The compressed file format (.WV) contains all original header information and the compressed audio data for one .WAV file.  The file can be used by WvUnpack to restore the original file, or the .WV file can be played directly in Winamp using the supplied plug-in.  WvUnpack restores the original file extension if one is not specified; this is handy when using the raw mode to compress non-wav files.
 
 

"Hybrid" Mode

The hybrid mode is a unique feature of WavPack. The default operation of WavPack is pure lossless, which means that the .WV file contains all the information that was in the original .WAV file. The hybrid mode (initiated with -b) allows the user to specify a target bitrate for the output file, either in kilobits per second (kbps) or bits per sample. If the track can be losslessly compressed without exceeding the specified bitrate, then it will be and WavPack will report the compression as lossless. If lossless compression would exceed the specified bitrate, then WavPack will begin carefully discarding the least significant portion of the audio information to stay within the limit. Every effort is made to keep this inaudible, including the use of joint stereo, dynamic bit allocation and noise shaping. WavPack will report this as "lossy" compression. Although the option accepts bitrates as low as 24 kbps, the actual value that WavPack can achieve is usually much higher than that. For example, with CD-audio sampled at 44.1k the lower limit is about 265 kbps.

If the -c option is specified (in addition to the -b option), then WavPack will generate an additional file that will contain the information that was discarded to generate the lossy .WV file. This file will have the same name as the .WV file but will have the extension .WVC (the 'c' is for "correction"). When WvUnpack is used to restore the .WAV file, it will attempt to find the .WVC file in the same directory as the .WV file. If it is found then the decompression will be lossless and will be reported as such, otherwise lossy decompression will be reported (assuming that any information was actually discarded during the original compression). If -c is specified but no actual information is discarded, the correction file will be deleted. The extra overhead involved with having these two files instead of a single pure lossless file is usually less than 1% of the original .WAV file. Note that CRCs are stored for both the lossy and lossless versions, so error detection works correctly whether the .WVC file is used or not.

I have done some informal testing and have found that 320 kbps gives audibly transparent operation in the vast majority of cases (at 44.1k, so this should be scaled up for higher sample rates). This is a reasonable size for keeping music permanently on a hard drive and for sharing, and also happens to be the maximum bitrate for the popular MP3 format. At bitrates above 320 kbps, the measured quality of the hybrid mode rises rapidy (about 1 dB less added noise for each 14 kbps), so WavPack provides an ideal bridge between the complex perceptual encoders and the lossless compressors.

Two options are provided to alter the default configuration of the hybrid compression. WavPack normally uses true-stereo, which means that it processes the two channels separately. However, in some cases (higher bitrates and little stereo information) it can be advantageous to activate joint-stereo in which case WavPack will work on the sum and difference of the two channels instead (sometimes called mid-side). Use the -j1 option to turn on joint-stereo processing if desired. Joint-stereo is the default for some lossless modes and can be turned off with -j0, but this can only change the compression ratio, not the sound. WavPack also uses first-order noise shaping to decrease the audibility of the added quantization noise by trading more noise at higher frequencies for less noise at lower frequencies (where it is more audible). However, the total noise is increased and so this processing is only used by default at higher sampling rates (above 64 kHz). Use the -s option to override this.

Self-Extraction

WavPack can also be used to create self-extracting archives. In this way it is possible to distribute compressed audio without having the recipient install any other programs (or have any dlls) to unpack the archives. When the .exe file is run (directly or by double-clicking) it extracts the original .wav file into the same directory. If it can't (because the file exists or it is run on a read-only device) then it displays a standard Windows "Extract to" dialog box and allows the user to specify the destination. The self-extracting feature can be used with WavPack's hybrid and raw modes as well as pure lossless. If a .WVC file (with the correct name) is present in the same directory as the executable, then a lossless extraction is automatically performed. The .exe files cannot be unpacked with WvUnpack or played with the Winamp plugin.

For detailed instructions on creating self-extracting WavPack files from existing .WV files, simply run the WvSelfx program. Otherwise, just use the -e option.
 
 

ID3v1 and APEv2 Tag Support

WavPack provides limited support for tags. Although it will not create the tags, it will allow you to use another program to append any kind of tag to the end of the .WV file (and the .WVC file, if desired). During decompression, WvUnpack will discard the tag so as not to corrupt the .WAV file. Additionally, if the tag is an ID3v1 tag or an APEv2 tag, the Winamp plugin will display the full artist and title in the playlist and additional items in the info dialog.
 

Other Notes:

WavPack and its associated utilities are free programs; feel free to give them to anyone who may find them useful. There is no warrantee provided and you agree to use them completely at your own risk. Be sure to visit www.wavpack.com for the latest version of WavPack.

 home