class Audio::AudioStreamFormat

Class to represent the audio stream format used for custom audio input configurations. Updated in version 1.5.0.

Members

~AudioStreamFormat

Syntax: public inline virtual ~AudioStreamFormat ( );

Destructor, does nothing.

operator SPXAUDIOSTREAMFORMATHANDLE

Syntax: public inline explicit operator SPXAUDIOSTREAMFORMATHANDLE ( ) const;

Internal operator used to get underlying handle value.

Returns

A handle.

GetDefaultInputFormat

Syntax: public inline static std::shared_ptr< AudioStreamFormat > GetDefaultInputFormat ( );

Creates an audio stream format object representing the default audio stream format (16 kHz, 16 bit, mono PCM).

Returns

A shared pointer to AudioStreamFormat

GetWaveFormat

Syntax: public inline static std::shared_ptr< AudioStreamFormat > GetWaveFormat ( uint32_t samplesPerSecond , uint8_t bitsPerSample , uint8_t channels , AudioStreamWaveFormat waveFormat );

Creates an audio stream format object with the specified PCM waveformat characteristics.

Parameters

  • samplesPerSecond Samples per second.

  • bitsPerSample Bits per sample.

  • channels Number of channels in the waveform-audio data.

  • waveFormat The format specified inside the WAV container.

Returns

A shared pointer to AudioStreamFormat

GetWaveFormatPCM

Syntax: public inline static std::shared_ptr< AudioStreamFormat > GetWaveFormatPCM ( uint32_t samplesPerSecond , uint8_t bitsPerSample , uint8_t channels );

Creates an audio stream format object with the specified PCM waveformat characteristics.

Parameters

  • samplesPerSecond Samples per second.

  • bitsPerSample Bits per sample.

  • channels Number of channels in the waveform-audio data.

Returns

A shared pointer to AudioStreamFormat

GetDefaultOutputFormat

Syntax: public inline static std::shared_ptr< AudioStreamFormat > GetDefaultOutputFormat ( );

Creates an audio stream format object representing the default audio stream format (16 kHz, 16 bit, mono PCM). Added in version 1.4.0.

Returns

A shared pointer to AudioStreamFormat

GetCompressedFormat

Syntax: public inline static std::shared_ptr< AudioStreamFormat > GetCompressedFormat ( AudioStreamContainerFormat compressedFormat );

Creates an audio stream format object with the specified compressed audio container format, to be used as input format. Support added in 1.4.0.

Formats are defined in AudioStreamContainerFormat enum.

Parameters

  • compressedFormat Compressed format type.

Returns

A shared pointer to AudioStreamFormat.