3 steps to ascertain whether two wav files are the same

Posted by: MangoMonkey on 15 January 2014

This might be interesting for folks who are trying to ascertain whether two cd rips are bit by bit identical. You'll need to install Audacity.

 

 

1) Import Files

a) File => Import => Audio (choose make a copy) -> First file

b) File => Import => Audio (choose make a copy) -> Second file

2) Select the first file, and do Effect Invert.

3) Select both files, and do Tracks => Mix and render

 

If you end up with Nothing, Just a 0.0 line, the two files have cancelled themselves out, indicating that both files indeed had the exact same data.

 

Enjoy!

 

Posted on: 15 January 2014 by Aleg

What is there to enjoy ???

 

cheers

 

Aleg

Posted on: 15 January 2014 by MangoMonkey

Evidently, nothing for you, but for others ...

Posted on: 16 January 2014 by Bart
Originally Posted by Aleg:

What is there to enjoy ???

 

cheers

 

Aleg

Intellectual pursuits and new knowledge to be discovered can be an enjoyment unto itself -- I do get the curiosity and interest in the technical as well as the melodical.  This hobby seems to have a lot to offer for both the left and right side of the brain.  Not that such is necessary.  But it's a big village this hi fi hobby.

Posted on: 16 January 2014 by Foxman50
How would you know which is the correct bit perfect rip though. Would be interesting to see if the same track downloaded from various sites returned a null.
Graeme
Posted on: 16 January 2014 by The Meerkat

Mangomonkey...Actually, that is very helpful to me. I have 300 albums ripped by a UnitiServe (Which is no longer part of my Naim kit) in WAV format. 

I have just started to re rip with XLD, so it will be interesting to see the comparison. Would it be a stupid question to ask, does the comparison have to be in the same file format? As I am re ripping to AIFF and FLAC.

 

Thank you

Posted on: 16 January 2014 by james n

XLD verifies the rip against the AccurateRip database so will do the verification for you - you'll see this information in the log file post rip. 

Posted on: 16 January 2014 by Dozey

In theory the best way would be to compare the hash values of the two files. I don't know how to do that in practice though.

Posted on: 16 January 2014 by Aleg
Originally Posted by Dozey:

In theory the best way would be to compare the hash values of the two files. I don't know how to do that in practice though.

With a hashing tool like this one http://www.nirsoft.net/utils/hash_my_files.html

 

Posted on: 16 January 2014 by MangoMonkey

You really can't use a hashing tool for this. If the meta-data is different, the hashes will be different, even though it's the same content.

 

In a test, I was able to get an exact match when I used a flac file and a wav file. Both were rips of the same cd. I used different DVD players for the rip.

 

This approach doesn't scale though, since it's time consuming, but you can use this approach to answer the question whether different rips are the same. If they are, you don't have to worry about which one is more correct. If they aren't, well that opens up another can of worms.

 

Posted on: 16 January 2014 by MangoMonkey
Originally Posted by The Meerkat:

Mangomonkey...Actually, that is very helpful to me. I have 300 albums ripped by a UnitiServe (Which is no longer part of my Naim kit) in WAV format. 

I have just started to re rip with XLD, so it will be interesting to see the comparison. Would it be a stupid question to ask, does the comparison have to be in the same file format? As I am re ripping to AIFF and FLAC.

 

Thank you

No, you should be able to compare both rips. Do report back whether Naim rips are any different than your xld rips.

Posted on: 16 January 2014 by likesmusic

dBpoweramp and foobar both have features which allow you to compare the data portions of two rips - in any format.  dBpoweramp also have some software called "PerfectTunes" which checks the checksums of all your rips against a central database. If you rip using dBpoweramp or XLD you will get the same Accuraterip checksum check as you rip.

 

If a naim rip is different from an Accuraterip verified XLD or dBP rip, then it is extremely likely that the naim rip is wrong, but you do need to make sure that you have corrected for drive offsets (dbP does this).

 

Posted on: 16 January 2014 by MangoMonkey

I have both dbpoweramp and foobar. How would you do the diff in said software? I didn't find anything obvious..

Posted on: 16 January 2014 by likesmusic
Originally Posted by MangoMonkey:

I have both dbpoweramp and foobar. How would you do the diff in said software? I didn't find anything obvious..

For dBpoweramp, download the "Calculate Audio CRC" from dBpoweramp codec central. Then run the dbBpoweramp batch convertor, select the files you want to check, click Convert and pick "Calculate Audio CRC" from the convert to dropdown.

 

For foobar you need to download and install the Binary Comparator component, and follow it's instructions: Put two groups of tracks to compare one after another in a playlist, select them and choose "Utils / Bit-Compare Tracks..." from the context menu.

 

Don't use foobar much, dBpoweramp is very quick.

 

Posted on: 16 January 2014 by MangoMonkey

sweet - it'll be easier to run dbpoweramp - and then write a script to do the crc comparison.

 

Audacity's comparison is way cooler though - if not as scalable. It's cool to see the inversion effect, and then mix the files to see a null result.

 

 

Posted on: 16 January 2014 by MangoMonkey
Originally Posted by Aleg:

What is there to enjoy ???

 

cheers

 

Aleg

To Aleg - ok, I admit it. Maybe it's geek fun, but still...

Posted on: 16 January 2014 by Bart

Nothing wrong with geeking out occasionally.

 

(Fortunately for me) Some women even like geeks.

Posted on: 16 January 2014 by likesmusic
Originally Posted by MangoMonkey:

sweet - it'll be easier to run dbpoweramp - and then write a script to do the crc comparison.

 

Audacity's comparison is way cooler though - if not as scalable. It's cool to see the inversion effect, and then mix the files to see a null result.

 

 

Whatever you fancy - but why not save your geek and just get the free trial of perfect tunes from dBpoweramp and have it all done for you?

Posted on: 17 January 2014 by Dozey

Sorry to rain on your parade, but checksums are useless to determine if a file is a bit perfect copy. It just shows that all the errors sum to zero!

 

For example, if all the bits are there but in the wrong order the checksum will be correct. It also is bad at detecting bit transposition. You really need to ignore the meta data and do a hash function on the remaining data.

Posted on: 17 January 2014 by Dan43

Thats correct. rsync via terminal will do a checksum copy of your original media but doesn't account for errors in that media, 1 and 0s do go bad. An example is a picture, if it is corrupted the info will transfer via rsync as an exact copy data wise but doesn't understand why the image looks wrong.

Dan43

Posted on: 17 January 2014 by mrspoon

"For example, if all the bits are there but in the wrong order the checksum will be correct. "

 

There is this possibility, however unlikely, a 32 bit check sum gives 4 billion different possibilities, in existence are only probably less than 60 million tracks in the world, so I would not worry about collisions on the CRC.

 

BTW the Calculate Audio CRC has the option to do a md5 hash also on the data, the possibility of a collision on that is astronomical.

Posted on: 17 January 2014 by Dozey
Yes, you have to be confident that a computer program uses a robust error check. There are bad ones.
Posted on: 17 January 2014 by likesmusic
Originally Posted by Dozey:

Sorry to rain on your parade, but checksums are useless to determine if a file is a bit perfect copy. It just shows that all the errors sum to zero!

 

For example, if all the bits are there but in the wrong order the checksum will be correct. It also is bad at detecting bit transposition. You really need to ignore the meta data and do a hash function on the remaining data.

I'm sorry, but that's just not true. If the order of the bits change, the CRC32 checksum will change tooo. The checksums we are talking about are not just simple additions of all the values, there's more to it than that. They are called Cyclic Redundancy Checksums and involve a bit of maths - check out how they work online. 

Posted on: 17 January 2014 by DavidDever

The other option might be to perform an A to C vs B to D comparison, where (given two lossless data files which need not be of the same type) the files are converted to a third type:

 

A is FLAC level 5 and is converted to AIFF (C), discarding all metadata

B is uncompressed PCM WAV and is converted to AIFF (D), discarding all metadata

Compare (C) & (D)

 

Think of the AIFF transcoding process as a reagent.

Posted on: 17 January 2014 by CharlieP

FWIW, one can load the data from a wave file into Matlab as a matrix or vector of numbers.  Once in memory, two such matrices (or vectors, in mono) can be subtracted.  Operators such as any() or all() or isequal() would facilitate quick comparisons.

 

Mind you, I have not done this, but it would be simple.  I do not own Matlab (which costs as much as a Hicap), but I use the free equivalent, Octave.  I have only tried to load files in WAV format.  I do not know if loaders or converters are available for other formats.  

 

Cheers,

 

Charlie

Posted on: 17 January 2014 by joerand

Mohit,

I applaud your topic on how to compare zeroes and ones !

 

 From the same guy that gave me this lighthearted castigation when I mentioned comparing two pressings of Dire Straits vinyl by actually listening to them........

 

 

December 13, 2013 8:48 PM


Originally Posted by MangoMonkey:
Compare two pressings? Almost like watching paint dry.. 

 

Well, I guess there are the vinyl geeks and then there are the streaming geeks .