WAVEFORMATEX 格式说明
来源:互联网 发布:小明避税 知乎 编辑:程序博客网 时间:2024/06/05 09:51
原文是从MSDN看到的过来的,大意如下:
WAVEFORMATEX
The WAVEFORMATEX structure specifies the data format of a wave audio stream.
WAVEFORMATEX 为波形音频流格式的数据结构
typedef struct
{
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
WORD cbSize;
} WAVEFORMATEX; *PWAVEFORMATEX;
- wFormatTag
- Specifies the waveform audio format type. For more information, see the followingComments section.
- 设置波形声音的格式,更多的信息请参考说明部分。
- nChannels
- Specifies the number of channels of audio data. For monophonic audio, set this member to 1. For stereo, set this member to 2.
- 设置音频文件的通道数量,对于单声道的声音,此此值为1。对于立体声,此值为2.
- nSamplesPerSec
- Specifies the sample frequency at which each channel should be played or recorded. IfwFormatTag = WAVE_FORMAT_PCM, then common values for nSamplesPerSec are 8.0 kHz, 11.025 kHz, 22.05 kHz, and 44.1 kHz. For example, to specify a sample frequency of 11.025 kHz, setnSamplesPerSec to 11025. For non-PCM formats, this member should be computed according to the manufacturer's specification of the format tag.
- 设置每个声道播放和记录时的样本频率。
- 如果wFormatTag = WAVE_FORMAT_PCM,那么nSamplesPerSec通常为8.0 kHz, 11.025 kHz, 22.05 kHz和44.1 kHz。例如对于采样率为11.025 kHz的音频,nSamplesPerSec 将被设为11025。对于非PCM格式的,请根据厂商的设定计算。
- nAvgBytesPerSec
- Specifies the required average data transfer rate in bytes per second. This value is useful for estimating buffer size.
- 设置请求的平均数据传输率,单位byte/s。这个值对于创建缓冲大小是很有用的。
- nBlockAlign
- Specifies the block alignment in bytes. The block alignment is the size of the minimum atomic unit of data for thewFormatTag format type. If wFormatTag = WAVE_FORMAT_PCM, setnBlockAlign to (nChannels*wBitsPerSample)/8, which is the size of a single audio frame. For non-PCM formats, this member should be computed according to the manufacturer's specification for the format tag.
Playback and record software should process a multiple of nBlockAlign bytes of data at a time. Data written to and read from a device should always start at the beginning of a block.
以字节为单位设置块对齐。块对齐是指最小数据的原子大小。如果wFormatTag = WAVE_FORMAT_PCM,nBlockAlign 为(nChannels*wBitsPerSample)/8。对于非PCM格式请根据厂商的说明计算。
- wBitsPerSample
- Specifies the number of bits per sample for the format type specified by wFormatTag. IfwFormatTag = WAVE_FORMAT_PCM, then wBitsPerSample should be set to either 8 or 16. For non-PCM formats, this member should be set according to the manufacturer's specification for the format tag. Some compression schemes cannot define a value forwBitsPerSample. In this case, setwBitsPerSample to zero.
- 根据wFormatTag的类型设置每个样本的位深(即每次采样样本的大小,以bit为单位)。如果wFormatTag = WAVE_FORMAT_PCM,此值应该设为8或16,对于非PCM格式,根据厂商的说明设置。一些压缩的架构不能设置此值,此时wBitsPerSample应该为零。
- cbSize
- Specifies the size, in bytes, of extra format information appended to the end of the WAVEFORMATEX structure. This information can be used by non-PCM formats to store extra attributes for thewFormatTag. If no extra information is required by the wFormatTag, this member must be set to zero. For WAVE_FORMAT_PCM formats, this member is ignored.
- 额外信息的大小,以字节为单位,额外信息添加在WAVEFORMATEX结构的结尾。这个信息可以作为非PCM格式的wFormatTag额外属性,如果wFormatTag不需要额外的信息,此值必需为0,对于PCM格式此值被忽略。
- 一般所需头文件和库文件:
- #include <dsound.h>
- #pragma comment (lib,"dsound.lib")
Members
- WAVEFORMATEX 格式说明
- WAVEFORMATEX 格式说明
- WAVEFORMATEX 格式说明
- WAVEFORMATEX格式说明
- WAVEFORMATEX 格式说明
- WAVEFORMATEX结构的说明
- WAVEFORMATEX结构的说明
- WAVEFORMATEX
- WAVEFORMATEX
- WAVEFORMATEX
- WAVEFORMATEX wFormatTag
- WAVEFORMATEX 解析
- AVI文件格式-WAVEFORMATEX
- AVI文件格式-WAVEFORMATEX
- GeoTIFF格式说明
- String.Format格式说明
- GUID格式符说明
- CHM格式说明
- 带百搭的麻将胡牌判断算法
- 图像增强之线性灰度增强
- win7 80端口被system占用
- 100个动规方程
- 当你输入信用卡号码的时候,有没有担心输错了而造成损失呢?其实可以不必这么担心, 因为并不是一个随便的信用卡号码都是合法的,它必须通过Luhn算法来验证通过。
- WAVEFORMATEX 格式说明
- JDK中设计模式
- 数据库 连接(JOIN)
- SQL之学生选课数据库
- 源代码学习笔记
- 367. Put the cart before the horse. 本未倒置
- 装修后才知道的79件事,无数网友真金白银砸出来的经验
- 网页设计第一章(第一课(2013-4-7))
- 央视《家有妙招》整理版,共250招,值得永远收藏