问题描述
我正在阅读有关wav文件的此教程,我有些困惑.
假设我使用PCM_16_BIT作为我的编码格式.所以这应该意味着我的每个声音样本都需要16位来表示它们,不是吗?
但是在本教程中,第二个图显示了4个字节作为一个样本.这是为什么?我想是因为它试图显示立体声录制的wav文件的格式,但是如果我有单声道录制的wav文件怎么办?在这种情况下,左和右通道值是否相等,或者通道值之一为0?如何运作?
I was reading THIS TUTORIAL on wav files and I have some confusions.
Suppose I use PCM_16_BIT as my encoding format. So this should mean each of my sound samples need 16 bits to represent them shouldn't it?
But in this tutorial, the second figure shows 4 bytes as one sample. Why is that? I suppose because it is trying to show the format for a stereo recorded wav file, but what if I have a mono recorded wav file? Are the left and right channel values equal in this case, or one of the channel values is 0? How does it work?
推荐答案
是的,对于16位立体声,您需要4个字节.对于单声道,您只需要两个字节即可用于16位PCM.检查一下:
Yes, for 16bit stereo you need 4 bytes. For mono, you just need two bytes for 16bit PCM. Check this out:
http://www.codeproject.com/Articles/501521/How-to-convert-between-most-audio-formats-in-NET
也请在这里阅读:
http://wiki.multimedia.cx/index.php?title=PCM
这篇关于需要帮助了解wav文件的数据部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!