覆盖PCM 16bit LE到WAV [英] Coverting PCM 16bit LE to WAV
问题描述
我正在尝试用C语言编写一个程序,将捕获的原始16kHz PCM 16位文件转换为 16位WAV .
I'm trying to write a program in C that converts a captured Raw 16kHz PCM 16-bit file to a 16-bit WAV.
我已经阅读了一些帖子,有人建议使用libsox
.安装了它,现在我真的很难理解手册页.
I've read some posts and people recommended using libsox
. Installed it and now i'm really struggling with understanding the man-page.
到目前为止(通过阅读源dist中的示例),我发现structs
:
So far (by reading the example in the source dist) I've figured out that the structs
:
- sox_format_t
- sox_signalinfo_t
可能用于描述我输入的数据.我还知道(如果有必要)我正在处理(时间)多少信息?
can probably be used to describe the data I'm inputting. I also know how much info i'm processing (time) if that is somehow necessary?
一些指导表示赞赏!
推荐答案
我建议手动编写WAV标头和数据,对于PCM来说,这确实非常简单: https://web .archive.org/web/20080706175634/https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
I would recommend to write WAV header and data manually, it is really very simple for PCM : https://web.archive.org/web/20080706175634/https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
更新:原始链接 https://ccrma.stanford.edu/courses/422/projects/WaveFormat/无效.
这篇关于覆盖PCM 16bit LE到WAV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!