如何在存储器中的音频数据保存为WAV文件? [英] how to save audio data in memory as a wav file?

查看:736
本文介绍了如何在存储器中的音频数据保存为WAV文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序调用 waveOutWrite(HWAVEOUT藿,LPWAVEHDR威尔斯亲王医院,UINT cbwh)在Windows上,我保存音频数据的副本(由pwh-> lpData所指向)发送到音频卡在存储器

When an application calls waveOutWrite(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) on windows, I save a copy of the audio data (pointed to by pwh->lpData) sent to the Audio Card in memory.

现在我要保存的音频数据在磁盘上的一个WAV格式的文件,我应该怎么做呢?

Now I want to save the audio data as a WAV format file on the disk, how should I do this?

我有指针的音频数据块和AUDO数据的大小。

I have the pointer to the audio data block and the size of the audo data.

推荐答案

WAV格式是的 pretty琐碎,易写你自己的实现。或者,您可以使用库如 libsndfile

The wav format is pretty trivial, and easy to write your own implementation for. Alternatively, you could use a library like libsndfile.

这篇关于如何在存储器中的音频数据保存为WAV文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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