I originally asked this question on Signal Processing but it was off topic. So, here it goes!
I tried to export a recording from Audacity twice, each time with the same parameters and tags. The resulting files had different checksums. So I opened up an diffed the two files (as binary).
My first try was a wav file containing a 32 bit float PCM. Only 3 bits were different in the whole file.
0000003c: 01000000 01001001 01110000 01010111 01001100 11100111 @IpWL.
became
0000003c: 01000111 01001001 01110000 01010111 01001100 11100111 GIpWL.
My first question is: what are these three bits used for?
Then I tried this same procedure with flac files. I will not paste it here because it would be too long, but what happened is that at the beginning of the file, there were only a few differences here and there, but the farther in the file I got the more it was apparent that the files were different.
Why is that? Isn't the flac compression algorithm deterministic?
Finally I took a wav file containing a 16 bit signed PCM and converted it to a 16 bit signed flac file, and then back to wav. The file I obtained is very similar to the original but it seems data is offseted by 33 bytes, as you can see from these samples of the files:
Original file:
00000294: 11111110 11111111 11111111 11111111 11111101 11111111 ......
0000029a: 11111011 11111111 11111100 11111111 11111110 11111111 ......
000002a0: 00000000 00000000 11111011 11111111 00000000 00000000 ......
000002a6: 00000001 00000000 00000010 00000000 00000001 00000000 ......
000002ac: 11111101 11111111 11111110 11111111 11111100 11111111 ......
000002b2: 11111100 11111111 11111101 11111111 11111101 11111111 ......
000002b8: 00000001 00000000 00000010 00000000 11111100 11111111 ......
000002be: 11111100 11111111 11111011 11111111 11111010 11111111 ......
000002c4: 00000010 00000000 00000010 00000000 00000000 00000000 ......
New File:
000002b2: 00000011 00000000 00000011 00000000 11111110 11111111 ......
000002b8: 11111111 11111111 11111101 11111111 11111011 11111111 ......
000002be: 11111100 11111111 11111110 11111111 00000000 00000000 ......
000002c4: 11111011 11111111 00000000 00000000 00000001 00000000 ......
000002ca: 00000010 00000000 00000001 00000000 11111101 11111111 ......
000002d0: 11111110 11111111 11111100 11111111 11111100 11111111 ......
000002d6: 11111101 11111111 11111101 11111111 00000001 00000000 ......
000002dc: 00000010 00000000 11111100 11111111 11111100 11111111 ......
000002e2: 11111011 11111111 11111010 11111111 00000010 00000000 ......
Why?