# WAV and lossless (FLAC, M4A) - MD5 hash comparisons



## jperryss (Mar 15, 2006)

Hi all,
This thread is a branch off from a couple of existing threads here and here. I'm hoping this prompts a bit of discussion on WAV 'vs' lossless audio formats. It certainly brought up a few questions to me.

Artist - Godsmack
Album - Awake
Title - Awake (track 2)
Programs used, dbpoweramp, foobar2000 v0.9.5.5, FLAC 1.2.1b.exe, md5check

I first ripped the track straight from the disc, to both WAV and FLAC formats. The MD5 hash of both files was noted.
I then manipulated the track between different lossless formats, using different programs, and performed an MD5 check at each step of the way. The filename was kept exactly the same: 'Godsmack-Awake' except for the file extension of course.

Original WAV rip (foobar2000)
*F2A5792E459EFE2C90570898D8498897*

Original FLAC rip (foobar2000)
*4C98B347545BC7A9D4D27CE3F3080F7C*


First, I simply converted the FLAC rip to WAV format, using foobar2000. Not too surprising, the MD5 of this file and the original WAV rip are identical.

Original FLAC rip -> WAV (foobar)
*F2A5792E459EFE2C90570898D8498897*

I then took the original WAV rip, then used dbpoweramp to convert it to an m4a (Apple Lossless) file, then used foobar2000 to convert back to WAV. Note that the MD5 hash remains the same as the original WAV.

Original WAV rip -> m4a (dbp) -> WAV (foobar)
*F2A5792E459EFE2C90570898D8498897*

Since people tend to complain about the Apple Lossless format (probably only due to the fact that iTunes doesn't play nice with any other losslessly-compressed formats) I then converted the original WAV file to m4a, using iTunes.

Original WAV rip -> m4a (iTunes)
*D5AEBCC6D4CF84C847C79C5985564AAB*

I then used foobar2000 to convert this file back to WAV. Look at that, the MD5 still matches the original WAV.

Original WAV rip -> m4a (iTunes) -> WAV (foobar)
*F2A5792E459EFE2C90570898D8498897*

Here comes the interesting part. I used the m4a file from two steps ago, then converted it to FLAC using foobar2000. The MD5 does NOT match the original FLAC rip.

Original WAV rip -> m4a (iTunes) -> FLAC (foobar)
*7BE696952781E5BC57846C8329F3CA8F*

I then converted this file back to WAV using foobar2000. Since the FLAC file in the previous step had a non-matching MD5, you would think that converting this FLAC file back to WAV would generate a completely different MD5 from the original WAV file, right? Wrong. The resulting WAV file is IDENTICAL to the original rip.

Original WAV rip -> m4a (iTunes) -> FLAC (foobar) -> WAV (foobar)
*F2A5792E459EFE2C90570898D8498897*




Conclusions (I think):
-There is truly no data loss or modification when switching from WAV to either FLAC or m4a lossless formats.
-iTunes, foobar, and dbpoweramp are all perfectly capable tools for converting from one lossless format to another.

Things to ponder:
-How can two FLAC versions of the exact same track, with different MD5 hash keys, generate an IDENTICAL WAV file when simply converted from FLAC to WAV?
-At what point between the original CD, a WAV rip of the original CD, and conversion to lossless does the resulting product sound 'different', if at all?
-I limited this experiment to strictly the file conversion process, which is admittedly a small piece of the entire picture. Burning this one track to disc at every step of the way, then re-ripping and comparing MD5 hashes would open up more answers (and questions, probably) but that'd be fairly time-consuming and would have to be for another day. Also, the ripping and burning processes themselves present many more variables, so I'm not sure how much more information could be extracted from a full beginning-to-end comparison.


----------



## ErinH (Feb 14, 2007)

awesome, man. I appreciate this info.

I rip nearly all of my stuff as ALAC simply because I am one of the few who actually enjoys iTunes and use it for my music library. WAV does not allow for tagging so I use ALAC; plus it's smaller in file size. So, it's great to know that the data is one-for-one. 
I probably couldn't tell the difference anyway. 

- Erin


----------



## WuNgUn (Feb 9, 2008)

Nice experiment...wish I had some answers!!


----------



## jperryss (Mar 15, 2006)

A full test (rip, convert, burn, rip again) would be optimal, but:

#1 It's time consuming.
#2 It's a bit harder to maintain consistency, I think.


----------



## jperryss (Mar 15, 2006)

OK, did another experiment.  This time I used NOFX's 'The Decline' album, which clocks in at 18 minutes and consists of a single track. This experiment consisted of ripping the original track and converting it to m4a twice: Once using DBP and once using iTunes. I then burned all three tracks (one WAV and two m4a) to disc as audio, using iTunes.

I also downloaded and installed EAC for the rip portion of test, and used the correct offset for my LiteOn DVD drive.

Original (100% per EAC log)
3300A984223D7B8A70787D377F30DAB7

I then converted this to m4a twice: Once using DBP and once using iTunes. I expected the two files to have a matching hash, but they did not:

DBP
EFDF2747B12E49DFE31A9EF7DB0CCDE8
iTunes
4D0B093B25F112C071CC36EAAC3FF9D5

I then burned the three files, as audio, using iTunes. Then, I popped the disc right back in the drive and ripped all three tracks, again using EAC.

Original (100% per EAC log)
A8189982C2059CCCE8454690443081B9
DBP (100% per EAC log)
A8189982C2059CCCE8454690443081B9
iTunes (100% per EAC log)
6B2259462501BBCDDB4B55891B15F2C5

Obviously something changed between the original rip and this second rip. Is the change audio-related or something buried in the 1s and 0s that would have no impact on the sound whatsoever? I don't know.

As far as why the resulting iTunes-converted track is different from the other two...again, who knows. I have two guesses: Either iTunes is 'tagging' the file somehow when it's ripped (likely IMO) or there is file degradation there (unlikely IMO).

What we do know is that whether you re-burn a WAV file, or convert said WAV file to m4a (using DBP) and then burn it, you should end up with identical results. 

As far as 'what you hear' I would bet there is no audible difference between the original and the three re-rips. It would be interesting to analyze the resulting tracks to determine what is actually different between the original and the re-rips (if anything) but I don't have the means or knowlegde to do that.


----------



## jperryss (Mar 15, 2006)

I should add that the difference in MD5 results does NOT indicate how 'different' the two files are. A very tiny change in the file will result in a very different MD5 result, and two hash results will never be 'almost' the same.

Example: Here's an MD5 hash of a text file I had on my computer:
59763942E2511AB3D51F523F0EBAFDDB
I then changed ONE character in the text file, and saved it. Here's the hash now:
83D6DD814AB22F7C51FAC4281DC98496

This is the main reason I wouldn't automatically assume that an iTunes-converted file is going to sound different.


----------



## m3gunner (Aug 6, 2008)

bikinpunk said:


> I rip nearly all of my stuff as ALAC simply because I am one of the few who actually enjoys iTunes and use it for my music library. WAV does not allow for tagging so I use ALAC; plus it's smaller in file size. So, it's great to know that the data is one-for-one.
> I probably couldn't tell the difference anyway.
> 
> - Erin


I'm also one of the iTunes users. Stereophile did a bit check on Apple Lossless files some time ago and found that the rips were bit perfect... when I read that, I started reripping my collection... this is a nice reconfirmation on that info with some real data...


----------



## jperryss (Mar 15, 2006)

Yep, I use iTunes almost exclusively.

As for the whole WAV 'vs' lossless 'vs' lossy compression thing, the interesting part to me is this (somehow I don't think I'm the only one):

I don't always trust my own ears to be able to tell the difference between two audio tracks by my ears alone, but I want to KNOW if one sounds better than the other. I don't want to wonder if my music could sound better based on the file format alone. I don't want to wonder if the format of the original file is the 'weak link'. I want to know for sure.

Two formats may sound slightly different from each other on my best day, and exactly the same the other 99% of the time. If I know that even at ONE point I could hear a difference between the two, that is enough to make me switch. I did it four years ago (re-ripped all my stuff to LAME v0 192VBR from a big range of MP3 bitrates) and did it again last year (re-ripped all my stuff to m4a lossless). I use m4a lossless because that is what my iPod plays, and WAV files are too big. It's also very easy to convert to m4a from any other lossless format.

I stick to m4a because I've heard the differences between well-ripped MP3 and m4a. I didn't want to admit it due to the massive undertaking of re-ripping my discs, but it was there and I finally succumbed. I don't think I'd ever detect a difference between m4a and WAV (if there even is an audible difference) but I've never A-B'd 'em because it's easier to convince myself that m4a is PERFECT and there'll be no difference anyway. Also, I ain't ripping my whole collection again. 

Between MP3 and m4a: Would I notice in the car at highway speeds? Probably not, but MAYBE.

Probably not though.


----------



## t3sn4f2 (Jan 3, 2007)

You can also compare by transcoding to the preferred lossless codec, opening the two files in Audacity, "inverting" the new one, and playing back both at the same time. If you hear ANYTHING then it's not an exact match.

Edit: By the way, Audacity can't open ALAC files, but I'm sure you can figure out a way around that, and at the same time further prove lossless transcoding _is_ lossless.


----------



## jperryss (Mar 15, 2006)

t3sn4f2 said:


> You can also compare by transcoding to the preferred lossless codec, opening the two files in Audacity, "inverting" the new one, and playing back both at the same time. If you hear ANYTHING then it's not an exact match.


Clever! I've never used Audacity but I see that it's free so I'll check into it.


----------



## adrenalinejunkie (Oct 17, 2010)

Bump from the dead for some great info.


----------



## jperryss (Mar 15, 2006)

Wow, totally forgot about doing this! Apparently I was on a mission, heh.


----------



## splaudiohz (Apr 1, 2011)

Getting quiality audio on disc from a FLAC DL can be a challenge. I have been ooking for a good program to properly convert to mp3 for the older Alpine hus and changers.


----------



## Sadus (Sep 8, 2011)

EAC is the standard for flawless rips today (it takes a little bit of setup at first though, I'm sure there are many guides out there), and foobar2000 is great for converting flac's to mp3s.

For Mac X Lossless Decoder (XLD) is supposed to be good.


----------



## splaudiohz (Apr 1, 2011)

Sadus said:


> EAC is the standard for flawless rips today (it takes a little bit of setup at first though, I'm sure there are many guides out there), and foobar2000 is great for converting flac's to mp3s.
> 
> For Mac X Lossless Decoder (XLD) is supposed to be good.


Thanks for the info. What do you mean by setup? As far as PC goes I am positive it is up to par, however the CD drive may need upgraded. Looking for suggestions there. Its out possible for CD/DVD players to read flac files?


----------



## Sadus (Sep 8, 2011)

splaudiohz said:


> Thanks for the info. What do you mean by setup? As far as PC goes I am positive it is up to par, however the CD drive may need upgraded. Looking for suggestions there.


The EAC program itself just has a lot of options that need configured (1 time only). Here is a basic guide: EAC Configuration Wizard - Hydrogenaudio Knowledgebase ... If you search for "EAC Guide" there are a bunch of others out there that get into even greater detail too.

Basically when you first run the setup wizard it tests the capabilities or your DVD/CD-ROM for certain features like Accurate Stream. Chances are your drive is fine though unless it is ancient, if you really are in the market for a new one I bet EAC's webpage has a list of recommended drives somewhere though. 



splaudiohz said:


> Its out possible for CD/DVD players to read flac files?


FLAC files burned to CD would just be sitting there as data files, just like if you burned some .mp3 or .txt files to a CD. Whether or not a CD/DVD player can play them depends on if that particular model can handle data CDs/DVDs (instead of just pure audio CDs), and if it knows how to play FLAC files, it depends on the model.


----------



## Arenumbi (Jul 31, 2017)

hi man,
sorry for my late answer, but focuses on sharing.
FLAC is awesome. Really, it is – as much as I hate FLAC listening purists, FLAC has a real place in the digital audio world that should not be overlooked.
You probably know of one other lossless audio format (even if you don’t know it’s lossless) called .WAV. Yep, that same, good ‘ol format that your Windows system sounds are encoded in (though that’s 8-bit and usually mono). WAV preserves 100% of audio information in 16-bit 44.1KHz stereo format when ripping audio from a CD.
FLAC is better than WAV for two reasons. First, it does everything WAV does (lossless audio), but in a much smaller package (WAV is extremely inefficient in its use of space). Second, it allows the use of more tags (including “illegal” tags in Windows) for marking files. That’s it. Otherwise, same juice, different label. WAV does have the advantage of being more editing / DJ-friendly (also less work for the CPU since it’s hardware decoded), but that’s not really relevant to what we’re talking about here. angway, they can convert to each other, just like me, I tried to convert FLAC to ALAC successfully. 
This gets us to why FLAC is awesome. It’s all about preservation and archiving! FLAC uses less space than WAV, and allows more precise tagging, making it ideal as a long-term digital storage medium for audio. No matter how many times you copy it (well, in the relative sense), generation after generation, the source audio remains virtually unaltered.
Real audiophiles love FLAC because it helps preserve recordings in their original state, even after multiple rips, digital copying, etc. And because it does so in a comparatively space-efficient format.


----------



## crackinhedz (May 5, 2013)

FLAC is my preferred choice.


----------



## imjustjason (Jun 26, 2006)

I really wish there was one standard, be it FLAC, WAV, ALAC, TIFF, DSD... whatever.


----------



## crackinhedz (May 5, 2013)

imjustjason said:


> I really wish there was one standard, be it FLAC, WAV, ALAC, TIFF, DSD... whatever.


I agree.

I also wish manufacturers would include decoding capabilities. I mean, its 2017 how hard would it be to allow a headunit the ability to play these files. I get that some may require licensing etc but a head unit that can only play .wav or .mp3?


----------



## nineball76 (Mar 13, 2010)

There never will be a single standard. Because everyone warts something different. Like those of you who swear by flac because it saves space. I truly don't care one single bit about that. Storage is cheap. I prefer AIFF for this reason. Essentially the same thing as WAV with the ability to store tags. I prefer the archived version to be uncompressed. Just my preference. Only reason I'd use FLAC is because head units support it. 

Sent from my LG-V20 using Tapatalk


----------



## imjustjason (Jun 26, 2006)

Here's my issue. I have a new DD that plays FLAC from a jump drive, hard drive, sd card... whatever, but it will NOT play ALAC from those things. I have MANY ipods that I can only play ALAC on... they will NOT play FLAC. So if I want to use the hard drive and the ipods I have to have two copies of all of my music. Don't get me started on the fact that in order to use the car play option I have to use the USB input that I would normally plug the ipod up to, so I have to physically change to the ipod if I want to.


----------



## juiceweazel (Jul 28, 2014)

imjustjason said:


> I really wish there was one standard, be it FLAC, WAV, ALAC, TIFF, DSD... whatever.


I think everyone would agree with this. Would make life easier for all. I lost all hope for universal standards when they couldn't even agree on one SD card (remember Sony duo).


----------

