Page 1 of 1
exporting 32-bit file as FLAC?
Posted: Thu Aug 14, 2008 4:03 am
by allencmcbride
When I export my 32-bit files as FLAC, I get the option of using 16 or 24 bits. But whichever I choose, when I re-import the FLAC, the track's info bar says "32-bit float" again. What does this mean? Did I convert (dither?) down to 16/24 bits when I exported, and then convert back up to 32 bits when I re-imported, therefore losing data even though FLAC is normally lossless? Thanks for your help! --Allen
Re: exporting 32-bit file as FLAC?
Posted: Thu Aug 14, 2008 4:56 am
by steve
Your 32 bit files are actually 32 bit float.
32 bit float have 24 bits as the fractional part and an extra 8 bit exponent. These extra 8 bits allow manipulation of the data with virtually zero loss, however when you are Importing or Exporting the data, it is the 24 bits that matter, and exporting as 24 bit is lossless. 24 bit wav files are not generally recommended - it's a very non-standard format, but 24 bit FLAC is no problem.
(Note that state of the art audio suites such as ProTools save as 24 bit - they wouldn't do that if it was lossy)
The maths are rather complicated, but if you're interested:
http://en.wikipedia.org/wiki/IEEE_754
Re: exporting 32-bit file as FLAC?
Posted: Thu Aug 14, 2008 2:01 pm
by allencmcbride
Thanks for the answer, now let me see if I understand... from reading
http://audacityteam.org/wiki/index.php?title=Bit_Depth, it sounds like the 8-bit exponent is only used during processing, so that's why exporting as 24-bit is lossless? (And even if I were importing and processing, say, an 8-bit file, I could avoid processing losses by converting to 32-bit for the processing and then re-exporting as 8-bit?)
Assuming I have that right, what about exporting a 32-bit float file as 16-bit FLAC and re-importing? Does that do what I was suggesting in my first post -- dither down to 16 bits and then add bits back on re-importing, therefore losing data?
Finally, a 32-bit file is at least theoretically capable of storing 32 meaningful bits of data per sample, right? So wouldn't it be theoretically possible to construct a 32-bit float file that couldn't be exported as 24 bits without losing data?
Thanks again.
--Allen
Re: exporting 32-bit file as FLAC?
Posted: Thu Aug 14, 2008 2:59 pm
by steve
allencmcbride wrote:it sounds like the 8-bit exponent is only used during processing, so that's why exporting as 24-bit is lossless?
I think that's about the size of it. 24 bit audio is still way above the specification of even professional level equipment, so even if there are some theoretical losses they will be so small as to be totally drowned out by real world audio equipment. ProTools users in professional recording studios have no worries about saving in 24 bit.
allencmcbride wrote:(And even if I were importing and processing, say, an 8-bit file, I could avoid processing losses by converting to 32-bit for the processing and then re-exporting as 8-bit?)
Audacity processes in 32 bit float anyway, so you probably would not gain anything by converting to 32 bit. Also 8 bit audio is very low quality and not selectable in Audacity, although you can still choose 8 bit as the export format.
There are some small quality advantages to setting 16 bit files to 32 bit before processing, even if you intend to export as 16 bit (you can do this simply by clicking on the track name and setting the bit depth from the frop down menu. The down side is that project file sizes double and there can be a reduction in multi-track performance.
allencmcbride wrote:what about exporting a 32-bit float file as 16-bit FLAC and re-importing?
If you export a 32 bit file as 16 bit (WAV, AIFF or FLAC), the file will be down sampled with dither. The type of dither can be selected in "Edit > Preferences > Quality". The default setting usually work best.
allencmcbride wrote:Finally, a 32-bit file is at least theoretically capable of storing 32 meaningful bits of data per sample, right? So wouldn't it be theoretically possible to construct a 32-bit float file that couldn't be exported as 24 bits without losing data?
Yes and no - you could use 32 bit integer rather than float, but there is no practical advantage in doing so and performance would probably be inferior.
Re: exporting 32-bit file as FLAC?
Posted: Thu Aug 14, 2008 3:02 pm
by steve
Some Mac users have reported major stability problems when using 24 bit files. I don't know if this still applies, or will apply to you, but if you are planning to use 24 bit files, you should test it out thoroughly before embarking on a major project.
Re: exporting 32-bit file as FLAC?
Posted: Fri Aug 15, 2008 4:33 am
by allencmcbride
Thanks again! Though my Mac takes an extremely long time to import a FLAC, it eventually seems to come out fine. --Allen