[Flac-dev] 32-bit float?

Brian Willoughby brianw at sounds.wa.com
Sun Apr 22 13:48:47 PDT 2007


Hi Ken,

We covered this recently, but I recall it was on the FLAC (user) list.

The FLAC format cannot handle float directly.  It can handle 32-bit  
integer, but no encoder exists.  The maximum you can encode now,  
without writing your own software, is 24-bit integer.

The interesting situation is that we cannot listen to 32-bit float  
directly without converting to 24-bit integer, so FLAC is perfectly  
suited for finished audio works.  You merely need to apply whatever  
32-bit float to 24-bit integer conversion that you would use for  
general listening or commercial distribution, and then use FLAC on  
the 24-bit result.  There are, however, many ways to do this,  
including truncation of fractional bits below the 24-bit integer LSB,  
or dithering.  In addition, 32-bit audio which might later be  
combined into an final audio piece could potentially hold useful  
information which would be lost if converted to 24-bit integer.

I would say that FLAC is ideal for archival of original recordings  
and finished works, since 24-bit integer is the maximum depth handled  
by analog converters.  The only real shortcoming is use on generated  
audio and intermediate mixes, either of which may contain fractional  
bits of potential significance in a final mix.

For your use, I would recommend using FLAC on the raw track input  
audio and your final mixes.  FLAC would not be the best choice for  
intermediate bounces, but those can be regenerated from the raw track  
data anyway.  It might be interesting to write a FLAC front-end for  
Ardour which looks for fractional bits when converting 32-bit float  
to FLAC, and warns you if there will be data loss.

Ogg Vorbis is a different algorithm and format, so it does not have  
the same limitations as the FLAC format.  Ogg-FLAC would not be able  
to handle 32-bit float, and probably won't handle 32-bit integer  
until some new software is written.

Brian Willoughby
Sound Consulting


On Apr 22, 2007, at 12:16, Ken Restivo wrote:

I notice that FLAC can't handle "broadcast" WAV's in IEEE float  
format-- the native file format of Ardour and JACK, among other  
things. It also can't seem to handle 32-bit integer format either.

Right now I have to convert WAV's to 24-bit before FLAC'ing it, then  
when converting it back again I've lost those bits. It'd be more  
"lossless" if I could actually leave it in its native format (float),  
then FLAC it, and then bring it back from FLAC into its original  
format without loss. This'd be especially useful for backing up  
Ardour session directories.

Interestingly, Ogg Vorbis can and does handle IEEE float WAV's and 32- 
bit WAV's without any trouble at all.

- -ken



More information about the Flac-dev mailing list