Why do Wav and Flac Files Sound Different?


This article is from 2016, so outfits like JRiver may have developed workarounds for the metadata/sound quality issues sussed out below. Inquiring minds want to know.

Why Do WAV And FLAC Files Sound Different?

"Based on these results, we attempted to pinpoint which section of the metadata might be responsible. Since the cover art file associated with the metadata is the largest contributor to the metadata header size, we began by examining the effect of deleting cover art prior to the WAV-to-FLAC-to-WAV conversion protocol. This proved fortuitous, as our first suspicion proved correct."

bolong

Showing 10 responses by erik_squires

I can believe that.  I've owned both JRiver and Media Monkey.  Honestly not a huge fan of either's UI, even less Qobuz, but I do think Media Monkey has a better overall handling of metadata. Do I think it affects the sound quality?  Absolutely not.

Do you all understand that the metadata and music data are not in the same places in the file or is that ... not relevant to this discussion?

The metadata, if read at all, is not interwoven with the music stream.  It's a completely separate part of the file, and from a performance issue, adding/removing files from one folder to another in a hard drive is no different than adding or removing another software program or game to your hard drive.  If these make a difference to your sound quality there's a very big error happening somewhere.

AFAIK, WAV always had metadata, just not cover art, but if you find a player that plays music differently because of the cover art, you should report it as a bug!

@moto_man We should separate two issues. Lossless, and recording quality.

WAV, FLAC, and ALAC should all be lossless formats, but I don’t do quality assurance on every algorithm out there which is converting from one to another, or used in CD ripping. It is technically possible that someone has a FLAC compression or CD ripping code that is not lossless, but if so it’s a bug.

The other part of this is the recording and playback quality which is affected by things such as the ADC, recording settings, digital filters on your DAC, etc. In an ideal world, of course, the playback is identical to the recording. If you are missing events there may be something going on.

There are a number of music analyzers out there that might be worth experimenting with to give you an answer.

 

It may help to think of an audio file as having 3 parts:

  • Metadata needed to read the byte stream and it’s location in the file
  • Optional metadata about the recording (Composer, artist, year of release, lyrics, album art)
  • The music data byte stream

Each of these chunks of information are entirely separate in the file, so as @audiotroy points out, the existence or absence of album art should make zero difference to the DAC.

The byte stream presented to the DAC should be identical regardless of optional metadata or indeed file format (FLAC, WAV, ALAC, etc.).

The one possible/plausible area I can see FLAC vs. WAV causing a difference is with poor streamers that don’t implement decompression (FLAC or ALAC) with adequate buffering and that somehow the time taken to decompress each chunk is affecting the rate at which samples are presented to the DAC. IMHO, this is possible, but certainly signs of poor design, not a feature of the file format.

If there IS a difference in a file because it has or does not have album art that would be a significant functional error/bug.

To end with a metaphor, imagine a vinyl record. The metadata is the text on the label. The cover art is on the cardboard sleeve, and the byte stream is the music in the groves. If you can hear a difference in an album because of the sleeve art you really have surpassed the boundaries of human capabilities.

@m2team00  It seems to be a relatively new feature to have album art in WAV files and not sure all converters support it.  See more here.

wav does not contain metadata while flac does

 

Um, beg to differ.  You are correct in that the existence of album art or metadata should make no difference to a properly behaving streamer.  Perhaps @audiotroy  you are conflating album art with metadata?  I just converted a file from FLAC to WAV and it had artist, album, year of release, etc. but the album art did not make it over.

I found this interesting article on album art however, and it seems this is a rather new capability for WAV files.

Important to note that some metadata is required for WAV and FLAC as it describes the data in the audio data container that explains how the stream of bytes should be interpreted.  Floating point vs. integer, number of channels, sample rate, etc. is all necessary for WAV files and part of the file format definition you may read more about here.

There is a second, optional part of metadata associated with human legible, descriptive tags.  Not actually needed to play a file, but certainly needed to organize a music library. 

@stilljd - The FLAC compression levels are aspirational. Think of them more as setting how much time to spend attempting to compress a song, more than how much they will compress a song.

That is, as you increase FLAC compression it spends more and more time to compress the data, but may not actually be able to do so.

@cundare2 No offense is taken.

HDCD was a way of encoding a variety of features into a 44.1 kHz/16 bit signal, most famously it was a way of encoding 24 bit data into 16 bits. This compression did in fact affect the original music, in the sense that the original 44.1 kHz/16 signal was no longer bit identical as it now had information encoded about dynamic range. HDCD was complex and encoded more features than just this.

MQA is also not a bit-perfect conversion. It attempts to encode in a low resolution signal (44.1/48.1, etc) high resolution content (96 kHz/24, or higher).

In the case of HDCD or MQA you are left with 44.1 kHz/16 bit data which is no longer bit-perfect of the original.

On the other hand, ALAC, FLAC and WAV formats though result in exactly the same bit-perfect signal resulting from decoding their files. Conversion between them to each other should result in exactly the same set of 44.1 kHz/16 bit data streams (if that’s what you started with). How they handled metadata might be different but in all cases the metadata is NOT encoded into the music stream.

OP:

The metadata and audio are separate. They share a file, but it’s not as if the album cover art is being sent per musical frame. It is in a different location, along with all the credits, so once the music starts to play, it is completely out of the picture. At best, these should could cause picoseconds of delay in starting to play the music, but zero when playing has begun.

HDCD and MQA however are interwoven into the music data itself.

It does take a little more CPU power to decompress FLAC or ALAC vs. WAV, which is going to take more network time, but if your player sounds different, it's messed up.

The only way you’ll ever convince me there’s a lick of difference between WAV and FLAC is with the jitter measurements.

It is _possible_ that the decompression has so much of an effect it overworks limited or pooor buffers and jitter control mechanisms, but IMHO, it’s the 21st century and any streamer at all in this day and age should perform equally well with either.

I should point out that any of this should be VERY streamer dependent.  Unique CPU's, algorithms and real-time software is probably running on each of them, so the idea that this is something shared among all of them is not believable. 

Also, take Roon, which essentially reads the files in the server and then seends them to each endpoint separately.  The data stream sent by Roon has been stripped of it's original format. What happens then?