如何编写与32位浮点数据的WAV文件? [英] How to write wav file with 32-bit float data?

查看:800
本文介绍了如何编写与32位浮点数据的WAV文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能写32位浮点采样PCM WAV文件。这似乎是一个有效的格式,因为libsndfile索赔予以支持。

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.

不过,如果我在标题中指定的32位样本大小,任何程序我打开它假定它是32位整型数据。需要什么标志等中的wav文件报头被设置为指定浮点数据?

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?

推荐答案

您需要设置wFormat标签中的FMT大块WAVE_FORMAT_IEEE_FLOAT(3)。

You need to set the wFormat tag in the 'fmt' chunk to WAVE_FORMAT_IEEE_FLOAT (3).

一个很好的来源,WAVE格式规范是此页

A good source for the WAVE format specification is this page.

这篇关于如何编写与32位浮点数据的WAV文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆