class Audio::AudioConfig

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

Members

operator SPXAUDIOCONFIGHANDLE

Syntax: public inline explicit operator SPXAUDIOCONFIGHANDLE ( ) const;

Internal operator used to get underlying handle value.

Returns

A handle.

SetProperty

Syntax: public inline void SetProperty ( const std::string & name , const std::string & value );

Sets a property value by name.

Parameters

  • name The property name.

  • value The property value.

SetProperty

Syntax: public inline void SetProperty ( PropertyId id , const std::string & value );

Sets a property value by ID.

Parameters

  • id The property id.

  • value The property value.

GetProperty

Syntax: public inline std::string GetProperty ( const std::string & name ) const;

Gets a property value by name.

Parameters

  • name The parameter name.

Returns

The property value.

GetProperty

Syntax: public inline std::string GetProperty ( PropertyId id ) const;

Gets a property value by ID.

Parameters

  • id The parameter id.

Returns

The property value.

~AudioConfig

Syntax: public inline virtual ~AudioConfig ( );

Destructs the object.

FromDefaultMicrophoneInput

Syntax: public inline static std::shared_ptr< AudioConfig > FromDefaultMicrophoneInput ( );

Creates an AudioConfig object representing the default microphone on the system.

Returns

A shared pointer to the AudioConfig object

FromMicrophoneInput

Syntax: public inline static std::shared_ptr< AudioConfig > FromMicrophoneInput ( const std::string & deviceName );

Creates an AudioConfig object representing a specific microphone on the system. Added in version 1.3.0.

Parameters

  • deviceName Specifies the device name. Please refer to this page on how to retrieve platform-specific microphone names.

Returns

A shared pointer to the AudioConfig object

FromWavFileInput

Syntax: public inline static std::shared_ptr< AudioConfig > FromWavFileInput ( const std::string & fileName );

Creates an AudioConfig object representing the specified file.

Parameters

  • fileName Specifies the audio input file.

Returns

A shared pointer to the AudioConfig object

FromStreamInput

Syntax: public inline static std::shared_ptr< AudioConfig > FromStreamInput ( std::shared_ptr< AudioInputStream > stream );

Creates an AudioConfig object representing the specified stream.

Parameters

  • stream Specifies the custom audio input stream.

Returns

A shared pointer to the AudioConfig object

FromDefaultSpeakerOutput

Syntax: public inline static std::shared_ptr< AudioConfig > FromDefaultSpeakerOutput ( );

Creates an AudioConfig object representing the default audio output device (speaker) on the system. Added in version 1.4.0

Returns

A shared pointer to the AudioConfig object

FromSpeakerOutput

Syntax: public inline static std::shared_ptr< AudioConfig > FromSpeakerOutput ( const std::string & deviceName );

Creates an AudioConfig object representing a specific speaker on the system. Added in version 1.14.0.

Parameters

  • deviceName Specifies the device name. Please refer to this page on how to retrieve platform-specific audio device names.

Returns

A shared pointer to the AudioConfig object

FromWavFileOutput

Syntax: public inline static std::shared_ptr< AudioConfig > FromWavFileOutput ( const std::string & fileName );

Creates an AudioConfig object representing the specified file for audio output. Added in version 1.4.0

Parameters

  • fileName Specifies the audio output file. The parent directory must already exist.

Returns

A shared pointer to the AudioConfig object

FromStreamOutput

Syntax: public inline static std::shared_ptr< AudioConfig > FromStreamOutput ( std::shared_ptr< AudioOutputStream > stream );

Creates an AudioConfig object representing the specified output stream. Added in version 1.4.0

Parameters

  • stream Specifies the custom audio output stream.

Returns

A shared pointer to the AudioConfig object