Hello,
I’m running Audacity 2.2.2, the latest version for Opensuse 15.2. I tried a simple test: recording silence into a FLAC file. When I import that file back into Audacity, the sound data is all non-zero! Small, but non-zero. Something in the -60dB range. But why is it not zero, or even all that close (I would expect it to be at least -96dB, what I should get with 16-bit FLAC). Help?
What I did:
start Audacity with a blank project.
Tracks->Add New->Stereo Track, at 44100 Hz Project Rate
Generate->Silence to generate 1 second of silence into this track.
Analyze->Sample Data Export to verify 44100 samples of 0. Ok so far
File->Export->Export Audio, saving as FLAC file, 16 bit depth, level 5 compression, called it sil.flac
closed Audacity without saving project
Restarted audacity with a blank project
File->Import Audio… to import sil.flac
Analyze->Sample Data Export to verify data. almost all entries are NON-0, most are +/- 0.00003, 0.00006 0.00009
Bummer! So much for lossless being lossless
Also interestingly, doing this three times to generate 3 files generates 3 different pairs of Frame Size Min/Max (as shown by exiftool).
Is there some random seed in FLAC generation? Why wouldn’t 44100 zero samples compress identically 3 times in a row?
I don’t have another way to read FLAC file sound data to see whether the non-zero data is coming during the writing of the file, or the importing of it (or both). I’ll attach my file here, so if someone else can tell whether this flac file encodes 44100 “0” data entries or not, that would be helpful. I would think that 44100 zero entries would compress really REALLY well, and the file is 27kbytes, so not all that small. Hence, I suspect the file is being written with non-zero data.
I suspect rounding errors from audacity’s internal 32-bit float to 16-bit integer, but a 32-bit float 0 should convert exactly to a 0 integer, I would think. And regardless, there’s 23 or 24 bits of precision in a normalized IEEE float, plenty to exactly encode all 16 bit integers. What’s going on? Can anyone else reproduce this? Is the Opensuse version a bad build? Is this a general problem with Audacity and FLAC? Is there another mechanism to write truly lossless FLAC files from data captured in Audacity?
–Dave