I'd like an explanation about the use of the -m switch in WavPack.
In the documentation it's said:
MD5 sums can also be used by WvUnpack during decompression to verify the data integrity of lossless files.
I created several .wv files without the -m option and corrupted them on purpose with a HEX editor.
When I verified them with WvUnpack I got an error, as I expected, so I don't understand whether I should use the -m option or not for extra peace of mind.
What do you think?
Does -m have an effect on wvpack.exe?
I suspect -m is just for decoders. (I bet MD5 sums are calculated for all files. It would be up to the decoder (or the user running the decoder) to decide whether to use them.)
Having an MD5 helps you check the file hasn't been modified from when you've encoded it without being corrupted.
Just to be clear, WavPack does not write an md5 sum by default. I originally put this in for traders who want the md5 sums in there to keep track of their recording versions, and WavPack already has error detection codes to identify corrupt files (and the WavPack codes work with lossy files too, unlike md5).
However, because the md5 sum is performed outside the WavPack library, it is somewhat more robust at finding errors caused by program bugs, algorithm limits or compiler issues. For example, the recent big-endian floating point bug showed up on md5 tests but not with the standard error detection codes. However, for simply detecting corrupt WavPack files, the default internal test is perfectly fine.