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).

Inheritance
builtins.object
AudioStreamFormat

Constructor

AudioStreamFormat(samples_per_second: int = None, bits_per_sample: int = 16, channels: int = 1, compressed_stream_format: AudioStreamContainerFormat = 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