Log in

View Full Version : WAV & FLAC...Same Data Different Sound.



Audiocom AV
12-03-2010, 09:19
WAV & FLAC...Same Data Different Sound.

I reported before in a thread that I found the playback of WAV files superior to FLAC, even though FLAC is lossless compression.

The better sound from WAV was consistent through all the Squeezebox players regardless of firmware.

This month in HFN Paul Miller went some way to explain why WAV & FLAC sound different. Paul explains; “crunch a FLAC file through your PC’S processor and although rendered perfectly intact, the pattern of jitter (etc) will almost certainly be different from that accompanying a WAV file rendered from the same hard drive through the same PC”.

twelvebears
12-03-2010, 10:09
WAV & FLAC...Same Data Different Sound.

I reported before in a thread that I found the playback of WAV files superior to FLAC, even though FLAC is lossless compression.

The better sound from WAV was consistent through all the Squeezebox players regardless of firmware.

This month in HFN Paul Miller went some way to explain why WAV & FLAC sound different. Paul explains; “crunch a FLAC file through your PC’S processor and although rendered perfectly intact, the pattern of jitter (etc) will almost certainly be different from that accompanying a WAV file rendered from the same hard drive through the same PC”.

Hi Mark.

That's interesting. Would that still hold true for a WAV produced from an lossless file?

I ask because all my music is stored losslessly but the additional storage space really isn't an issue so I could uncompress my files to WAVs if this is the case.

Only other issue is that I don't believe WAV files support ID3 tags? If this is the case, that's a big bunch of messed up files if the library gets screwed up....

Stratmangler
12-03-2010, 10:19
I've just had a look at the settings on my Squeezebox Server client (the latest version 7.4.2), and have found that WAV is converted by SOX to FLAC. This is the default setting.
SOX also adjusts sample rates on the fly so that any given player receives hi-res material at a bit depth/sample rate it can cope with.

This might possibly account for sonic differences.

Audiocom AV
12-03-2010, 10:45
Hi Mark.

That's interesting. Would that still hold true for a WAV produced from an lossless file?

I ask because all my music is stored losslessly but the additional storage space really isn't an issue so I could uncompress my files to WAVs if this is the case.

Only other issue is that I don't believe WAV files support ID3 tags? If this is the case, that's a big bunch of messed up files if the library gets screwed up....

Hi Steve

If you convert a WAV to FLAC and then from FLAC back to WAV I am not certain if there would be any sound quality differences.

WAV files do not support ID3 tags.

Cheers,
Mark

Themis
12-03-2010, 10:47
This month in HFN Paul Miller went some way to explain why WAV & FLAC sound different. Paul explains; “crunch a FLAC file through your PC’S processor and although rendered perfectly intact, the pattern of jitter (etc) will almost certainly be different from that accompanying a WAV file rendered from the same hard drive through the same PC”.
I don't understand Paul's explanation... does he mean that two identical WAV files stored in memory (one produced by program A and one produced by program B) are streamed differently ? :scratch:
As the streaming program doesn't know who produced the file, how could this happen ?

ZebuTheOxen
12-03-2010, 12:20
He means;
If you run a WAV file and FLAC'd version of the same file, the jitter will be different.

The streaming program *will* handle the files differently, but I'm not sure of the innards of FLAC and how the conversion process takes place. Buffering between the processor and D/A unit should alleviate these issues.

It wouldn't surprise me if the jitter was different though.

Krisbee
12-03-2010, 12:35
What do I need to hear this difference? Super-duper high end audio gear strapped to my PC and/or golden ears?

I've no wish to be rude, but I'm very sceptical about this. I don't buy/read HFN so it would be interesting to know if “Paul's explanation” comes from an in-depth article or not. Just what hardware and software were used and how? How was this “pattern of jitter” measured and how is it supposed to translate into audible differences in this case?

The explanation seems rather vague to me. When he talks of “crunch a FLAC file through your PC’S processor “, does he mean at play back time or when the original WAV file is being encoded into FLAC? If he is referring to play back, does he not think the processor is “crunching” a WAV file too?

When he says “the pattern of jitter (etc) will almost certainly be different”, what is the etc? Why “almost certainly”, either it is or it is not, or only in some cases, or has probability x of being different. Or perhaps like deciding if light is a wave or a particle, there is different pattern of jitter on Mondays, Wednesdays and Fridays but not on the other days of the week.

Surely it's a simple matter for anyone using audio files stored on a PC hard drive to run an A/B test to decide if they can hear any difference between a ripped wav file and the same file encoded as flac.

In Linux, you can easily check a lossless file with something like:


flac -8 origianal.wav
flac -d -o copy.wav original.flac
md5sum original.wav
md5sum copy.wav

If the md5sums match then the conversion it is regarded as lossless.

Here's my playback test. The CLI was used to avoid ALSA dmix and any rate or bit-depth conversion taking place. The device hw=0.0 is in fact a TC-7520 connected via usb.


$ mplayer -ao alsa:device=hw=0.0 "01 - Piano Concerto No. 20 in D Min, K460 - 2nd Movement, Romance.flac"
MPlayer SVN-r30040-4.4.1 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 01 - Piano Concerto No. 20 in D Min, K460 - 2nd Movement, Romance.flac.
Audio only file format detected.
================================================== ========================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 537.4 kbit/38.08% (ratio: 67172->176400)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
================================================== ========================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 565.8 (09:25.7) of 566.0 (09:26.0) 0.6%

Exiting... (End of file)





$ mplayer -ao alsa:device=hw=0.0 "01 - Piano Concerto No. 20 in D Min, K460 - 2nd Movement, Romance.wav"
MPlayer SVN-r30040-4.4.1 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 01 - Piano Concerto No. 20 in D Min, K460 - 2nd Movement, Romance.wav.
Audio only file format detected.
================================================== ========================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
================================================== ========================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 279.6 (04:39.6) of 566.0 (09:26.0) 0.1%

MPlayer interrupted by signal 2 in module: play_audio
A: 279.7 (04:39.6) of 566.0 (09:26.0) 0.1%
Exiting... (Quit)

Using a FLAC file introduces additional decoding into the processing which happens as data is placed on the USB bus.

I cannot hear a difference. From which I conclude that there either is a difference and I cannot hear it, or there isn't a difference so I won't hear one. Of course, your results may be different, but then I won't be listening with your ears and brain.

My audio chain is a PC running Linux > TC-7520 (usb connection) > Rotel RA-01 > AVI Neutron III. May be not high end, but not rubbish. The day I change my audio hardware is the day I run the test again to satisfy myself that there is, or is not, an audible difference in play back between a ripped WAV file and when it has been encoded as a FLAC file.

Stratmangler
12-03-2010, 12:42
I was intrigued by this notion of there being an audible difference between FLAC and WAV files, so I have conducted a little experiment of my own.

I ripped just one track of a CD.
To make it a bit more all encompassing I decided to rip to 2 lossless uncompressed formats and 2 lossless compressed formats.
These formats are WAV, AIFF, ALAC & FLAC respectively.
All tracks were ripped with the same ripping tool (dbPoweramp), and all tracks were ripped securely on first pass and returned identical AccurateRip results. Indeed, the checksums for all of the rips were identical.

I then copied the file over into My Music on my system, and adjusted the value of WAV playback to native in my Squeezebox Server client - all the other formats were already set as native, so no need to adjust anything.

Then I sought out the folder with the four rips and had a listen.
I used my laptop to control the playback and view the gui interface remotely, and I had no indication as to which track was which in terms of playback.
And I can't hear any bloody difference between any of them !

Which leads me to a number of possible conclusions.

Either there are no audible differences or my system does not resolve highly enough to make the differences audible or my hearing is shot, or maybe any combination of the previous options apply.

YMMV

Themis
12-03-2010, 13:33
He means;
If you run a WAV file and FLAC'd version of the same file, the jitter will be different.

The streaming program *will* handle the files differently, but I'm not sure of the innards of FLAC and how the conversion process takes place. Buffering between the processor and D/A unit should alleviate these issues.

It wouldn't surprise me if the jitter was different though.
The words chosen to describe the effects are different. He claims "crunch a FLAC file through your PC’S processor and although rendered perfectly intact..." which means that we have two identical WAV files.

We are not talking about sending two different files (FLAC and WAV) to an external device : we are talking about two identical files, because the FLAC processing passes the *whole* file to the streaming process. From the streaming process's perspective, these are the *same data* placed in two different memory locations.
If there's a difference, it would be that even if you stream twice the *same* WAV file, then you could have different results. Because every time you play a file, it resides in different memory locations anyway.
This is absurd, and no computer could ever work with such inconsistencies.

leo
12-03-2010, 14:36
When I was trying the Hi-face USB to S/dif device using Foobar , Flac sounded noticeably softer and smaller than WAV (to my ears), dynamic and complex material sounded flatter less 3D than WAV .
With the modded Duet as a transport running Squeezecenter 7.4 I can also hear a difference between Flac and WAV although the differences are smaller than when I tried the Hi-face with Foobar

What settings etc are folks using with Squeezecenter?

ZebuTheOxen
12-03-2010, 14:38
The words chosen to describe the effects are different. He claims "crunch a FLAC file through your PC’S processor and although rendered perfectly intact..." which means that we have two identical WAV files.
Well he doesn't specify whether he's playing a Wav -> FLAC -> Wav vs. converted original Wav, or a FLAC vs. Wav situation.
I completely agree his wording is opaque (How can it be perfectly intact but different?! Digital doesn't work like that) but you've made that assumption.

By your assumption his description is thoroughly idiotic I agree. A wav is a wav is a wav. There's nothing hidden in the 1s and 0s. Especially using Accuraterip and assorted bit-checking technologies.

The jitter is a result of the D/A part of the process. If we're just working with digital then it's all within tolerence and the 1s and 0s are still the same.
If he's implying the digital part of the process is at fault, then it's like saying a jitterless version of Windows (If there could ever be such a thing) would load faster than one without... Laughable.


This is absurd, and no computer could ever work with such inconsistencies. Computers will just try and try again until they get the correct answer, not something you have the luxury of doing in real time audio without significantly increasing data transfer rates to allow for this. MADI is based on FDDI tech anyway, I have a sneaking suspicion it already does this.

Edit: Any differences you hear playing Wav and FLAC must be down to settings within your players, there's no difference to the output.

Stratmangler
12-03-2010, 14:48
What settings etc are folks using with Squeezecenter?

Almost default in my case - WAV files do not process natively in 7.4.2 so I had to adjust the way WAV is dealt with to be native.

Oh, and before I forget, volume is fixed at 100%, and preamp attenuation set to 63.
I'm using SB3 as transport into a Caiman via coax.

The volume settings might be very relevant to the situation.

leo
12-03-2010, 15:06
The differences are audible to me here so I'd like to be sure I don't have anything set differently to those that can't hear a difference:)

The s/pdif signal into all my dacs measured best with attenuation set to 90, going full 100 adds a little clipping according to the scope.
I don't use the Duet to adjust volume

Krisbee
12-03-2010, 15:33
Just to add, that in my case the TC-7520 DAC is used as a pre-amp. The Rotel RA-01 volume control is on max and all software volume control on the PC is by-passed.

K3b was used to rip my sample track with a paranoia setting of 2. Encoding to FLAC was done at the CLI with: flac -8 sample.wav , the best compression setting. No replay gain was used.

AFAIK, this means the volume of my WAV and FLAC play back should be the same.

twelvebears
12-03-2010, 15:38
By your assumption his description is thoroughly idiotic

Erm..... I don't think that's necessary. This is opinion, so let's keep it that way and avoid the personal remarks please.

Stratmangler
12-03-2010, 15:43
The differences are audible to me here so I'd like to be sure I don't have anything set differently to those that can't hear a difference:)

The s/pdif signal into all my dacs measured best with attenuation set to 90, going full 100 adds a little clipping according to the scope.
I don't use the Duet to adjust volume

If I read that correctly Leo you are using the volume control to set the volume to 90. The output level choices are that volume is fixed at 100% or the volume control controls level.
Setting the preamp attenuation level to 63 mutes the output from the analogue outputs altogether.

ZebuTheOxen
12-03-2010, 15:50
Erm..... I don't think that's necessary. This is opinion, so let's keep it that way and avoid the personal remarks please.
It was directed at Paul Miller's comments, but I apologise should he read this thread. A naivity in understanding how the files are presented is obvious though.

leo
12-03-2010, 16:03
I'll try it at 100 ,I'm sure it was mentioned somewhere as long as the spdif out is kept higher than 80 you don't loose quality

Just want to eliminate anything that may be causing the differences

twelvebears
12-03-2010, 16:05
It was directed at Paul Miller's comments, but I apologise should he read this thread. A naivity in understanding how the files are presented is obvious though.

The fact remains however that people are hearing differences, and more to the point people who I would believe have pretty good ears....

Interestingly Mark from Audiocom is not the first I've heard mention WAV being better than lossless, the guy who runs Item Audio said the same during a conversation.

For the sake of a couple of hundred Gb I'd be happy to give it a go but not unless there's an uncompressed format that supports ID3 tags properly.

Themis
12-03-2010, 16:19
What settings etc are folks using with Squeezecenter?
I transform FLACs into PCM on the server. ;)
FLAC->FLAC = disable
FLAC->PCM = flac

ZebuTheOxen
12-03-2010, 16:21
It's not possible to inject ID3 tagging into WAVs without breaking compliance unfortunately.

This was discussed a while ago over at Hydrogrenaudio without a satisfactory conclusion.

The problem comes in where non-compliance is concerned, and it's no good putting ID3 information into the wav file just anywhere since none of the players will find it without specifically telling them :( Anyway...

Rare Bird
12-03-2010, 16:31
I don't like these topics as they are very silly IMHO..I wish everyone would take it that noting is as good as FLAC yet.. :eyebrows:

Themis
12-03-2010, 16:32
Well he doesn't specify whether he's playing a Wav -> FLAC -> Wav vs. converted original Wav, or a FLAC vs. Wav situation.
I completely agree his wording is opaque (How can it be perfectly intact but different?! Digital doesn't work like that) but you've made that assumption.

By your assumption his description is thoroughly idiotic I agree. A wav is a wav is a wav. There's nothing hidden in the 1s and 0s. Especially using Accuraterip and assorted bit-checking technologies.

The jitter is a result of the D/A part of the process. If we're just working with digital then it's all within tolerence and the 1s and 0s are still the same.
If he's implying the digital part of the process is at fault, then it's like saying a jitterless version of Windows (If there could ever be such a thing) would load faster than one without... Laughable.

Computers will just try and try again until they get the correct answer, not something you have the luxury of doing in real time audio without significantly increasing data transfer rates to allow for this. MADI is based on FDDI tech anyway, I have a sneaking suspicion it already does this.

Edit: Any differences you hear playing Wav and FLAC must be down to settings within your players, there's no difference to the output.
Yes, that's exactly what I meant, Tom. ;)

In other words, there *may* be differences when you use two different processes to stream (say, one from WAV and another, totally different, from FLAC) and these differences, if they exist, denote either a bug or a different use of the material ressources (clock etc).

But, as most streaming software don't have the ability to deal directly with FLACs (or other individual formats) they usually call an external process to obtain a PCM file. The same as WAV.
In other words, the streaming software has two identical PCM files, one obtained from file management (a software) and another obtained from a FLAC converter (another software). Assuming there's no bug, these files are the same. ;)

Mr. C
12-03-2010, 16:33
We have WAV and FLAC files of the same recordings, same sample and bit rates, even when using foobar I can not detect a difference between them when using the same equipment and LEVEL MATCHING.
I will speak to Paul ands ask him about this.

Themis
12-03-2010, 16:34
It's not possible to inject ID3 tagging into WAVs without breaking compliance unfortunately.

This was discussed a while ago over at Hydrogrenaudio without a satisfactory conclusion.

Tags are stored in the header part. Compliance in the header part is not a big deal.
But, I agree, this is not ideal/satisfactory.

Themis
12-03-2010, 16:44
The fact remains however that people are hearing differences, and more to the point people who I would believe have pretty good ears....

Interestingly Mark from Audiocom is not the first I've heard mention WAV being better than lossless, the guy who runs Item Audio said the same during a conversation.

For the sake of a couple of hundred Gb I'd be happy to give it a go but not unless there's an uncompressed format that supports ID3 tags properly.
Steve, if there are differences, then the most possible cause should be found and a plausible explanation oughts to be given.

But, put like that : "FLAC sounds different than WAV" sounds like a mix of causes and effects which gives little margin for logical explanations. To me, someone could as well claim that everytime he listens to the same album through the same setup there are differences, I would not even bother to try to find a plausible explanation. Because the highest probability is that the main cause is the listener himself. ;)

StanleyB
12-03-2010, 16:46
It is possible to store tags in WAV. I use Tag ad Rename (http://www.softpointer.com/) for that.
There are also tags in the audio files on a CD. Some CD players can read these tags and display them.

ZebuTheOxen
12-03-2010, 16:55
A quick bit of searching (and a bit of wiki) turns up:
AIFF (non-compressed and lossless) does ID3v2 in a RIFF chunk called ID3.
BWF (Broadcast Wave Format) is the 'standardised' approach to tagging wav files.

Getting these to work on players will be hit and miss though.

Less than ideal, as you say Themis.

Krisbee
12-03-2010, 17:09
I agree with Themis in that I'd like a plausible and logical explanation. But perhaps Andre is right to think that a "I can hear it/I can't hear it" thread doesn't always get us very far. So I'll stick to FLAC .


mplayer -ao alsa:device=hw=0.0 "Rameau - Concerts Mis en Simphonie - Reyne.flac"

Gives me 71mins of all the charm and elegance of the French Baroque. It's music to my ears. :)

leo
12-03-2010, 20:05
I better have a read into this, quite interested now to see what I'm doing wrong, certainly was clear audible differences between Flac and WAV with foobar using Hiface so I'm especially interested to find what was happening there especially since a lot of albums are Flac:scratch:

Themis
12-03-2010, 21:04
Perhaps a replay gain applied for FLACs ? ;)

Stratmangler
12-03-2010, 21:37
Perhaps a replay gain applied for FLACs ? ;)

Aye, you've got to be careful with what you click on.