Jump to content
IGNORED

Program to compare 2 audio files?


Recommended Posts

Is there a (free?) program that can do a bit for bit comparison of 2 files, both of which are in Apple Lossless?

 

I did 2 rips of a beater CD of Song for a Seagull - one using iTunes, and the other using XLD.  I'd like to see how the bits came out w.r.t. errors.

Link to comment
2 hours ago, Ralf11 said:

Is there a (free?) program that can do a bit for bit comparison of 2 files, both of which are in Apple Lossless?

 

I did 2 rips of a beater CD of Song for a Seagull - one using iTunes, and the other using XLD.  I'd like to see how the bits came out w.r.t. errors.

 

I don't think that you want to do a bit-for-bit comparison as there may be differences in the metadata of the two files.

 

Instead you can use xACT to generate .st5 checksums of the uncompressed audio portion of the files. 

 

If xACT doesn't work with Apple Lossless, use XLD to convert both to flac.

 

More information here:

 

http://www.thetradersden.org/forums/showthread.php?p=300188#post300188

 

You may also be able to use XLD to compare the files to the AccurateRip database. I think you need a cue file for this.  

Sometimes it's like someone took a knife, baby
Edgy and dull and cut a six inch valley
Through the middle of my skull

Link to comment

You can generate a checksum for the actual audio portion of an ALAC file using afhash  (which is part of OS X), followed by the filename,  and you can compare those of two files if the hash is embedded (which you can do with the -w argument):

 

afhash yourfilename.m4a
afhash  -c  youraudiofilename.m4a  yourotheraudiofilename.m4a

 

Quote

AFHASH(1)                 BSD General Commands Manual                AFHASH(1)

NAME
     afhash -- Audio File Hash

SYNOPSIS
     afhash [-h] audiofile1 audiofile2

DESCRIPTION
     Audio File Hash writes an SHA-1 hash to an audio file or prints (to stdout) the hash contained in an
     audio file

OPTIONS
     -h       print help text

     -w       write hash code to audio file

     -x       print hash code from audio file (if present)

     -c       compare hash codes from two audio files

Darwin                         February 13, 2007                        Darwin
Normal Termination

 

 

Link to comment

dunno that much about this stuff - I do know that the same bits can be in containers (is that like a containerized cargo cult?)

 

I want to see if iTunes does an adequate job of ripping CDs or something else (like XLD which can use a database on at least some CDs) would be better

 

To test, I chose a beat up CD Song to a Seagull, as Joni is getting pretty old these days.  Recent photos show evidence of bit rot...

Link to comment

afhash -w fn1 fn2 returns:

 

No hash in file.

SHA1 Hash of audio data : 893e459d254220e7a8aafd4929d8479bd3cb30d8

etc. etc.

 

for both switches I used the Finders drap & drop facility to get the fn's & path on there as arguments

 

BeyondCompare didn't seem to work, perhaps due to the metadata

Link to comment
2 minutes ago, Ralf11 said:

afhash -w fn1 fn2 returns:

 

No hash in file.

SHA1 Hash of audio data : 893e459d254220e7a8aafd4929d8479bd3cb30d8

etc. etc.

 

for both switches I used the Finders drap & drop facility to get the fn's & path on there as arguments

 

BeyondCompare didn't seem to work, perhaps due to the metadata

 

I've never used afhash but I'm guessing you can't add a hash to a file and compare in one operation.

 

Try:

 

afhash -w fn1

 

Then:

 

afhash -c fn1 fn2

 

 

 

 

Sometimes it's like someone took a knife, baby
Edgy and dull and cut a six inch valley
Through the middle of my skull

Link to comment
17 hours ago, Ralf11 said:

Nyet!  same or simiar errors

 

I finally gave up and listened to both sets of song - XLD did not solve all the pops/Snaps/crackles

- unclear if it is any better...

 

Just close your eyes and pretend you're listening to vinyl. I hear it's what all the cool kids are doing these days.

Sometimes it's like someone took a knife, baby
Edgy and dull and cut a six inch valley
Through the middle of my skull

Link to comment

I forgot one important thing.  You can write the hash to AIFF but not to ALAC.

 

(I figured out a way to do it if for some reason you want to:  Write the hash to the resource fork.  I wrote a script a few years ago, I think posted on my blog, called "betroth" that does this.  It checksums the audio portion of the files, and stores the checksum in the associated resource fork.  Then you have it periodically examine the file, comparing the extant checksum to that embedded in the resource fork, and it alerts you if a difference is detected.  Such alerts were the first sign I had of a failing external HHD, which I since have replaced with a SSD).

Link to comment
18 minutes ago, wgscott said:

I forgot one important thing.  You can write the hash to AIFF but not to ALAC.

 

Thanks, Bill. I played with the cmd a little yesterday and got errors when trying to write the hash to various FLAC and ALAC files.

 

BTW, it also works with WAV files so it looks like it's uncompressed data that causes it to chokes.  

Sometimes it's like someone took a knife, baby
Edgy and dull and cut a six inch valley
Through the middle of my skull

Link to comment

There is a hashtab app and checksum utility app in the mac app store for $1.99 on either.  I haven't used either. 

 

I also thought you could open a terminal window and put MD5 space filename to get an MD5 checksum.  I'll have to try that. 

And always keep in mind: Cognitive biases, like seeing optical illusions are a sign of a normally functioning brain. We all have them, it’s nothing to be ashamed about, but it is something that affects our objective evaluation of reality. 

Link to comment

In the terminal you can use MD5 file name or shasum file name. 

 

iHash is a free app in the Mac app store which is much easier.  You drag and drop the file name, and get a checksum of your choice.  Copy it.  Then try the second file and paste the first one you copied to see if the two match.  If you are only doing a few files it should serve you fine. 

 

Of course this is if the metadata is the same.  

 

For checking audio bits, about as easy to just open one in audacity.  Open the second one and invert.  Then mix and render.  You should come up with all zeroes. 

And always keep in mind: Cognitive biases, like seeing optical illusions are a sign of a normally functioning brain. We all have them, it’s nothing to be ashamed about, but it is something that affects our objective evaluation of reality. 

Link to comment
18 minutes ago, wgscott said:

 

Why would you want to do this when /usr/bin/afhash does the same thing, but with the audio content only (thus eliminating irrelevant differences in the metadata)?

Because some of ralf's entries indicated afhash wasn't working for him. So I offered an alternative with the metadata.

And always keep in mind: Cognitive biases, like seeing optical illusions are a sign of a normally functioning brain. We all have them, it’s nothing to be ashamed about, but it is something that affects our objective evaluation of reality. 

Link to comment
2 hours ago, Ralf11 said:

Thanks - I tried MD5 alone and with a filename - got nothing.

 

I think I'll close down this experiment and move on to something else.

Try the iHash.  It is a drag and drop graphical way to do it.  If they match fine. 

 

If not, then try Audacity. Could be metadata if they don't match.  Audacity also lets you look at the metadata to see if that is the same or not. 

 

Open one file, then open the second file in the same window. 

Select the second file and under Effects apply Invert. 

 

Then select both tracks and under Tracks select Mix and Render.  If you get a straight line with nothing in it, you have two bit identical files.  Once you have done this it only takes a couple dozen seconds to compare two files. 

 

You also might try Max. 

http://sbooth.org/Max/#max

 

That way you could see if XLD and Max results match that iTunes is the outlier.

And always keep in mind: Cognitive biases, like seeing optical illusions are a sign of a normally functioning brain. We all have them, it’s nothing to be ashamed about, but it is something that affects our objective evaluation of reality. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...