How to write wav file with 32-bit float data?

不羁岁月 提交于 2019-11-30 00:44:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!