简体   繁体   English

IMA ADCPM 转 Wav

[英]IMA ADCPM to Wav

I have a byte array with IMA ADCPM data stored, readed from a special file format.我有一个字节数组,其中存储了 IMA ADCPM 数据,从特殊文件格式读取。 I would like to know how I could write it in a.WAV file.我想知道如何将它写在 .WAV 文件中。 The rate/frequency is 32000 Hz and only has 1 channel (mono).速率/频率为 32000 Hz,只有 1 个通道(单声道)。

I'm not experimented in writing audio files and I don't know how to do it.我没有尝试过编写音频文件,也不知道该怎么做。

Thanks!谢谢!

I can tell you how to write a wav file - that's not too hard.我可以告诉你如何编写一个 wav 文件——这并不难。 But I don't think it will work as you might expect.但我认为它不会像你预期的那样工作。

If you've just opened the File as a byte[] and try to write that to a WAV, you're just going to get a lot of horrible noise, and not the sound you expect.如果您刚刚以 byte[] 格式打开文件并尝试将其写入 WAV,您只会得到很多可怕的噪音,而不是您期望的声音。 The sound format IMA is a compressed sound format - and you'd need to know how to un-compress that stream into 'raw' sound.声音格式 IMA 是一种压缩声音格式 - 您需要知道如何将 stream 解压缩为“原始”声音。 This 'raw' sound is what a WAV file is.这种“原始”声音就是 WAV 文件。 it's just a header that describes what the raw data represents - such as playback speed and bytes per sample.它只是一个 header 描述了原始数据所代表的内容 - 例如播放速度和每个样本的字节数。 https://alvas.net/ can handle this for you, saving you the hard work. https://alvas.net/可以为您处理,省去您的辛苦。

If however, you really want to try and write your own decoder, have a look here: https://wiki.multimedia.cx/index.php?title=IMA_ADPCM但是,如果您真的想尝试编写自己的解码器,请查看此处: https://wiki.multimedia.cx/index.php?title=IMA_ADPCM

I can't find the original source I used (many years ago) for creating a WAV file, but here's an old blog that seems to contain enough information.我找不到我(多年前)用于创建 WAV 文件的原始来源,但这是一个似乎包含足够信息的旧博客。

https://m8051.blogspot.com/2010/08/wave-sound-file-in-pcm-format-long-lost.html https://m8051.blogspot.com/2010/08/wave-sound-file-in-pcm-format-long-lost.html

Good luck!祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM