I would like to be able to write PCM wav files with 32-bit floating point samples. This seems to be a valid format since libsndfile claims to support it.
However, if I specify in my header a sample size of 32-bits, any program I open it in assumes that it's 32-bit integer data. What flags, etc need to be set in the wav file header to specify floating point data?
Can anyone point me to some documentation that explains how to do this?
24-bit audio recordings can capture a dynamic range of up to 144.5 dB. Meanwhile, 32-bit float audio can capture the absolutely ludicrous range of up to 1,528 dB. That's not only massively beyond the scope of 24-bit audio, but it's beyond the scale of what even counts as a sound on Earth.
Compared to fixed-point files (16- or 24-bit), 32-bit float files store numbers in a floating-point format. This is fundamentally different than fixed point, because numbers in these WAV files are stored with “scientific notation”, using decimal points and exponents (for example “1.4563 x 106“ instead of “1456300”).
You need to set the wFormat tag in the 'fmt' chunk to WAVE_FORMAT_IEEE_FLOAT (3).
A good source for the WAVE format specification is this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With