game_chat_audio_format
描述解释游戏聊天 2 音频数据所需的格式信息。
语法
typedef struct game_chat_audio_format {
uint32_t sample_rate;
uint32_t channel_mask;
uint16_t channel_count;
uint16_t bits_per_sample;
game_chat_sample_type sample_type;
bool is_interleaved;
} game_chat_audio_format
成员
sample_rate
类型:uint32_t
播放或录制每个通道时使用的样本频率。
channel_mask
类型:uint32_t
覆盖多通道音频流中的通道到扬声器位置的分配时使用的渠道过滤。 对于本值的位数转扬声器映射,请参阅对 Microsoft Docs 上 WAVEFORMATEXTENSIBLE 结构的 dwChannelMask 成员描述。要使用默认映射,请设置为 0。
channel_count
类型:uint16_t
指定音频数据的通道数量。
bits_per_sample
类型:uint16_t
指定每个样本的位数。 如果此值不能被字节整除,将假定包含的样本类型使用位填充以使其能够被字节整除。
sample_type
类型:game_chat_sample_type
指定游戏聊天 2 是在使用由整数 (game_chat_sample_type::integer) 表示还是由浮点数 (game_chat_sample_type::ieee_float) 表示的 PCM 数据。
is_interleaved
类型:bool
表示多通道音频流是否交错以呈现多通道格式的标志。
从游戏聊天 2 检索的音频将始终标记为交错。 此参数在 game_chat_audio_format::channel_count 大于 1 时有意义。
备注
本结构用来描述游戏聊天 2 中的预编码音频流、后期解码音频源流和后期解码音频接收器流。 以下功能获得或设置 game_chat_audio_format
,由相应流对象使用:
- pre_encode_audio_stream::get_pre_processed_format
- pre_encode_audio_stream::set_processed_format
- post_decode_audio_source_stream::get_pre_processed_format
- post_decode_audio_sink_stream::set_processed_format
有关音频格式的详细信息,请参阅 实时音频操作。
要求
头文件:GameChat2.h
支持平台:Windows、Xbox One 系列主机和 Xbox Series 主机
另请参阅
游戏聊天 2 简介
chat_manager
pre_encode_audio_stream
post_decode_audio_sink_stream
post_decode_audio_source_stream
GameChat2 成员