问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/2062620/how-to-write-wav-file-with-32-bit-float-data