WAV->FLAC->WAV ... identical?

Hey everyone,

First of all! I love Audacity. It can do so much more than I will ever want to know, but if there is a problem here (and not between the chair and the keyboard), hopefully this can be used to help improve it.

I know this seems like a no brainer on the surface maybe, but as an experiment I took some arbitrary WAV file I exported from an MP3 as a reference and then, using Audacity 2.0.2 (upgrading to 2.0.5 as we speak), I exported the WAV to FLAC and then took that FLAC and re-exported to WAV.

So…

file 1 - some MP3 (just a source to get a WAV from and irrelevant for the rest of this)
file 2 - WAV exported from file 1
file 3 - FLAC exported from file 2
file 4 - WAV exported from file 3

So since I’m going from an uncompressed format to a compressed, lossless format back to the same uncompressed format, I’m expecting file 2 and file 4 to be identical - like bit for bit.

That is not what I see. I hexdumped file 2 and file 4 and here is a snippet…

To be clear, the first 240 bytes (up to offset 0xF0) is identical. That seems to be where some header/tag information lies. Beyond that, this transformation is definitely not lossless. Also this is hexdumped on a little endian machine (x86) so every 16-bit word is byte flipped.

00000f0: 0100 0000 ffff 0200 fdff 0300 feff 0100  ........... | 00000f0: 0000 0300 fbff 0600 faff 0500 fdff 0100  ...........
0000100: ffff 0100 ffff 0200 fdff 0200 0000 ffff  ........... | 0000100: 0000 0000 ffff 0200 fcff 0400 0100 faff  ...........
0000110: 0200 fdff 0200 ffff 0000 0200 fdff 0300  ........... | 0000110: 0600 fcff 0500 fcff feff 0400 fbff 0700  ...........
0000120: feff 0100 0000 0000 0000 0100 ffff 0000  ........... | 0000120: fdff feff 0100 0300 0100 feff fdff 0300  ...........
0000130: 0100 feff 0300 fcff 0400 fcff 0400 fdff  ........... | 0000130: 0100 fcff 0700 f7ff 0800 f7ff 0900 fdff  ...........
0000140: 0100 0000 0000 0100 feff 0200 feff 0200  ........... | 0000140: fdff 0500 f9ff 0a00 f9ff 0500 f6ff 0900  ...........
0000150: ffff 0000 0100 feff 0300 fdff 0200 0000  ........... | 0000150: feff 0100 fdff 0100 0400 fcff 0000 0400  ...........
0000160: ffff 0100 0000 feff 0300 fdff 0200 0000  ........... | 0000160: faff 0500 feff 0000 0000 feff 0300 0000  ...........
0000170: feff 0200 feff 0100 0000 0000 0000 0000  ........... | 0000170: feff 0000 0000 ffff 0300 0000 ffff fdff  ...........
0000180: ffff 0200 feff 0100 0100 fdff 0400 fdff  ........... | 0000180: 0000 0700 fbff fcff 0500 ffff 0400 f8ff  ...........
0000190: 0100 0000 0000 ffff 0300 fcff 0300 feff  ........... | 0000190: 0300 0400 fcff ffff 0300 0000 0000 feff  ...........
00001a0: 0100 0000 ffff 0100 0000 0000 0000 feff  ........... | 00001a0: feff 0300 ffff 0300 fcff 0200 ffff 0000  ...........
00001b0: 0300 feff 0200 feff 0100 ffff 0100 ffff  ........... | 00001b0: 0300 fdff 0200 fcff 0500 fdff 0100 fdff  ...........
00001c0: 0200 fdff 0300 fdff 0200 ffff 0100 0000  ........... | 00001c0: 0600 fbff 0300 fdff 0300 0000 ffff ffff  ...........
00001d0: ffff 0000 0100 ffff 0100 0000 feff 0300  ........... | 00001d0: ffff 0200 0300 faff ffff 0600 feff 0300  ...........
00001e0: fdff 0200 0000 ffff 0100 ffff 0000 0100  ........... | 00001e0: f8ff 0500 0300 feff fdff feff 0600 ffff  ...........

From this, if I kept cycling through WAV->FLAC->WAV in Audacity, I’m thinking after a while I’d be accumulating errors.

I don’t think I’m misunderstanding lossless compression. Am I?

Thanks!

Did you turn dither off?

Scientists are rarely impressed with Audacity because it’s not a WAV editor. It’s a show or production editor. It’s goal is to sound good, not produce mathetically significant results.

Audacity > Edit > Quality. Turn dithering off and as long as you have Audacity set to the same bit depth (16-bit) all through the process, the match should be much better.

Koz