博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WAVEFORMATEX 格式说明
阅读量:6786 次
发布时间:2019-06-26

本文共 3149 字,大约阅读时间需要 10 分钟。

hot3.png

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;

Members

wFormatTag Specifies the waveform audio format type. For more information, see the following
Comments 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. If
wFormatTag = 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, set
nSamplesPerSec 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 the
wFormatTag format type. If
wFormatTag = WAVE_FORMAT_PCM, set
nBlockAlign 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. If
wFormatTag = 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 for
wBitsPerSample. In this case, set
wBitsPerSample 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 the
wFormatTag. 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格式此值被忽略。

转载于:https://my.oschina.net/guqiwei/blog/351103

你可能感兴趣的文章
RedHat发布JBoss 7.2,完全支持Java EE 8规范
查看>>
kubernetes1.9.2基于kubeadm的高可用安装HA
查看>>
「性能优化之道」每秒上万并发下的Spring Cloud参数优化实战
查看>>
App启动流程
查看>>
原理 | 分布式链路跟踪组件 SOFATracer 和 Zipkin 模型转换
查看>>
我的第一篇博客
查看>>
手把手教你如何用Python从PDF文件中导出数据(附链接)
查看>>
维珍银河完成最长距离火箭飞行,下一步剑指太空旅行
查看>>
[Python]attributeError:'module' object has no attribute 'dump'
查看>>
Docker系列教程11-使用Nexus管理Docker镜像
查看>>
业界最全,阿里云混合云灾备服务上线!
查看>>
Windows Linux 子系统可以在资源管理器中打开
查看>>
WebStorm文件类型关联设置
查看>>
13.1 Spring MVC 关于controller的字符编码
查看>>
理发店与 App 定价模型
查看>>
ES6(数组)
查看>>
php simplexml_load_file 函数执行不稳定
查看>>
C#,VB.NET如何将Word转换为PDF和Text
查看>>
玩转Kafka的生产者
查看>>
解决android.permission.WRITE_APN_SETTINGS
查看>>