你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

AudioStreamFormat Class

Represents specific audio configuration, such as microphone, file, or custom audio streams

When called without arguments, returns the default AudioStreamFormat (16 kHz, 16 bit, mono PCM).

Constructor

AudioStreamFormat(samples_per_second: int | None = None, bits_per_sample: int = 16, channels: int = 1, compressed_stream_format: AudioStreamContainerFormat | None = None, wave_stream_format: AudioStreamWaveFormat = AudioStreamWaveFormat.PCM)

Parameters

Name Description
samples_per_second

The sample rate for the stream.

Default value: None
bits_per_sample

The number of bits per audio sample

Default value: 16
channels

The number of audio channels

Default value: 1
compressed_stream_format

The compressed stream format defined in AudioStreamContainerFormat

Default value: None
wave_stream_format

The wave stream format defined in AudioStreamWaveFormat

Default value: AudioStreamWaveFormat.PCM