FLAC versus WAV
If people report an audible difference between WAV and FLAC, almost invariably WAV is reported to sound better.
Of course there are counter claims, no audible differences at all and when these two opposing views are expressed in a forum it often becomes lively.
Most of us are not really scientist. Out testing is causal. Most of the time it is a sighted test. You know what is playing and of course the purest of the purest, the uncompressed lossless format will win.
There might be some expectation bias involved.
Is it possible that these formats do sound different?
As both are lossless a simple typical computer style test is:
Take a WAV file
Convert it to FLAC
Convert the FLAC back to WAV
If you look at both WAV-files in the file system you might see a difference in size.
For some a reason to post in a forum like:
I convert WAV to FLAC and back and the file size is different. FLAC is not lossless, FLAC is BROKEN!!!!!
You better dont. Often in these conversions some space is created in the header for tags.
If you store tags in the header, you need some space. If you run out of space the whole file must be rewritten so allocating some space a priori is a good strategy.
You need an additional step, the null test.
load both in an audio editor
time align
subtract the 2 tracks.
Many have done this and the result is always the same: zeros only.
Obvious the content is bit identical.
These type of experiments teaches us that is cannot be the content of the file causing the audible difference.
Ok, might it be the player doing something.
An additional and intriguing experiment is to record the SPDIF out.
This is exactly what is send to the DAC.
It the player treats WAV and FLAC different, we will record different bits
Play the WAV,
Play the FLAC
Record both
Do the null test.
This type of testing is a bit rare as it does require some technical skills and some recording gear. An example known to me is a guy using this method to test differences between iTunes and Amarra playing the same track at its native sample rate.
Zero differences found.
But a lot of people claim to hear a difference.
Im confident if someone would do this experiment with a FLAC and a WAV, the result will also be zero differences. FLAC is lossless compression by design.
When you play it, it will be expanded to e.g. 16 bits / 44.1 just like the original source.
What do all these test have in common?
They test the bits.
PCM audio is samples + sample rate.
Maybe the variations in timing (oh no, not jitter again) explains it.
To play FLAC you need to expand it first. This requires a bit more processing power than playing WAV.
There are claims that any electrical activity going on inside a PC disturbs in some way or other the clock timing the audio and maps itself into sample rate jitter.
Increased system activity will decrease the sound quality.
This is pretty much like having a video card and the more system activity, the more your screen starts to blur!
One might argue that if sound quality fluctuates with system load, this indicates a design flaw.
As a consequence, on a well-designed system you wont hear any difference and on the ones with a crappy sound card, you do.
If all this is true, the difference in sound quality is not a property of the file format but a hardware problem.
What about memory playback.
We have a media player
- Load the track in memory
- Expand it on the fly to raw PCM
- Start playback when the song is fully loaded an converted
Will we again hear a difference between FLAC and WAV?
What do we need?
Somebody with that bloody expensive gear able to measure the jitter on the digital out when playing WAV or FLAC.
Beside sound quality, there are a couple of other differences.
Both can be tagged. As there is no standard for tagging WAV, the results are poor.
If the media player write tags (the emphasizes is on the word if), another media player probably won't read them.
FLAC supports tagging including album art.
FLAC incorporates a checksum (MD5) in the header. If a file becomes corrupted, the decoder will signal it.
The bonus: FLAC is between 50-60% of the size of a WAV. A terabyte comes cheap these days but if you have the files on a local HD and 2 backups, its reduced file size is convenient.