Nov 20

Comparison of lossless audio compression options

Category: Linux,multimedia   — Published by goeszen on November 20, 2015 at 4:17 pm

Similiar to the posts Comparison of lossless video compression options and Recompress DV lossless?, where we look at options to compress or re-compress video without sacrificing quality, or introducing a new generation - now, here, we'll have a look at schemes to compress lossless audio losslessly. In particular, how can we get the size of a WAV file down?
Again, this comparison is completely unscientific - so take it with a grain of salt.

Comparison_wav_compression_s

Have a look at these numbers. They're interesting. All compressors were run with default (usually "middle" or "modest" settings) via file-roller. Only flac ran with --best set.
The result: forget traditional zip, it's not compressing WAVs that well (that said, newer zip formats allow modular compression algorithms, which might be similar in result to 7z or rar). RAR's compression is best, right after FLAC, and 7z in default performs nicely as well.
One side note: I ran 7z with -mx=9 (ultra) as well, and the resulting file was 557.5MB, only 1.4MB smaller, but compression took much longer!

I did another test with 5 minutes of sine wave audio, generated with $ sox -n channel1.wav synth 300 sin 347. The resulting WAV file is roughly 57MB, and processing it, 7z performed best, compressing the audio down to ~2.5MB! It seems, some compressors are able to recognize repeating patterns within WAV (RIFF) files, while others (looking at you zip) are not specifically suited for WAV audio files.

So, having a .zip file might be a good way to bundle a few files into one, but preferable use it with it's compression set to 0/off, solely as archiver, and add .flac encoded wavs. One down side, I haven't fully investigated, is that FLAC doesn't seem to be able to process and keep all tags a WAV file, especially when coming from a professional/broadcast environment, may carry (also, extreme bitrates, sample frequencies). Also, with broadcast wav BWF files, compressing with RAR instead of converting to FLAC seems the only option.

Leave a Reply

=