Agora C++ API Reference for All Platforms
Public Member Functions | Protected Member Functions | List of all members
agora::rtc::INGAudioDeviceManager Class Referenceabstract

Inherits agora::RefCountInterface.

Public Member Functions

virtual agora_refptr< IRecordingDeviceSourcecreateRecordingDeviceSource (char deviceId[kAdmMaxDeviceNameSize])=0
 
virtual int setMicrophoneVolume (unsigned int volume)=0
 
virtual int getMicrophoneVolume (unsigned int &volume)=0
 
virtual int setSpeakerVolume (unsigned int volume)=0
 
virtual int getSpeakerVolume (unsigned int &volume)=0
 
virtual int setMicrophoneMute (bool mute)=0
 
virtual int getMicrophoneMute (bool &mute)=0
 
virtual int setSpeakerMute (bool mute)=0
 
virtual int getSpeakerMute (bool &mute)=0
 
virtual int getPlayoutAudioParameters (AudioParameters *params) const =0
 
virtual int getRecordAudioParameters (AudioParameters *params) const =0
 
virtual int setDefaultAudioRouting (AudioRoute route)=0
 
virtual int changeAudioRouting (AudioRoute route)=0
 
virtual int getCurrentRouting (AudioRoute &route)=0
 
virtual int getNumberOfPlayoutDevices ()=0
 
virtual int getNumberOfRecordingDevices ()=0
 
virtual AudioDeviceInfo getPlayoutDeviceInfo (int index)=0
 
virtual AudioDeviceInfo getRecordingDeviceInfo (int index)=0
 
virtual int setPlayoutDevice (int index)=0
 
virtual int setRecordingDevice (int index)=0
 
virtual int followSystemPlaybackDevice (bool enable)=0
 
virtual int followSystemRecordingDevice (bool enable)=0
 
virtual int setApplicationVolume (unsigned int volume)=0
 
virtual int getApplicationVolume (unsigned int &volume)=0
 
virtual int setApplicationMuteState (bool mute)=0
 
virtual int getApplicationMuteState (bool &mute)=0
 
virtual AudioDeviceInfo getLoopbackDeviceInfo (int index)=0
 
virtual int setLoopbackDevice (int index)=0
 
virtual int followSystemLoopbackDevice (bool enable)=0
 
virtual int registerObserver (IAudioDeviceManagerObserver *observer, void(*safeDeleter)(IAudioDeviceManagerObserver *)=NULL)=0
 
virtual int unregisterObserver (IAudioDeviceManagerObserver *observer)=0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Protected Member Functions

 ~INGAudioDeviceManager ()
 
- Protected Member Functions inherited from agora::RefCountInterface
virtual ~RefCountInterface ()
 

Detailed Description

The INGAudioDeciceManager class.

This class provides access to audio volume and audio route control, as well as device enumeration and selection on the PC.

Constructor & Destructor Documentation

◆ ~INGAudioDeviceManager()

agora::rtc::INGAudioDeviceManager::~INGAudioDeviceManager ( )
inlineprotected

Member Function Documentation

◆ createRecordingDeviceSource()

virtual agora_refptr<IRecordingDeviceSource> agora::rtc::INGAudioDeviceManager::createRecordingDeviceSource ( char  deviceId[kAdmMaxDeviceNameSize])
pure virtual

Creates a audio device source object and returns the pointer.

Returns

◆ setMicrophoneVolume()

virtual int agora::rtc::INGAudioDeviceManager::setMicrophoneVolume ( unsigned int  volume)
pure virtual

Sets the volume of the microphone.

Parameters
volumeThe volume of the microphone. The value range is [0, 255].
Returns
  • 0: Success.
  • < 0: Failure.

◆ getMicrophoneVolume()

virtual int agora::rtc::INGAudioDeviceManager::getMicrophoneVolume ( unsigned int &  volume)
pure virtual

Gets the volume of the microphone.

Parameters
volumeThe volume of the microphone.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSpeakerVolume()

virtual int agora::rtc::INGAudioDeviceManager::setSpeakerVolume ( unsigned int  volume)
pure virtual

Sets the volume of the speaker.

Parameters
volumeThe volume of the speaker. The value range is [2, 255].
Returns
  • 0: Success.
  • < 0: Failure.

◆ getSpeakerVolume()

virtual int agora::rtc::INGAudioDeviceManager::getSpeakerVolume ( unsigned int &  volume)
pure virtual

Gets the volume of the speaker.

Parameters
volumeThe volume of the speaker.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setMicrophoneMute()

virtual int agora::rtc::INGAudioDeviceManager::setMicrophoneMute ( bool  mute)
pure virtual

Captures or stops capturing the local audio with the microphone.

Parameters
muteDetermines whether to capture or stop capturing the local audio with the microphone.
  • true: Stop capturing the local audio.
  • false: (Default) Capture the local audio.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getMicrophoneMute()

virtual int agora::rtc::INGAudioDeviceManager::getMicrophoneMute ( bool &  mute)
pure virtual

Gets the mute state of the microphone.

Parameters
muteThe mute state of the microphone.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSpeakerMute()

virtual int agora::rtc::INGAudioDeviceManager::setSpeakerMute ( bool  mute)
pure virtual

Plays or stops playing the remote audio with the speaker.

Parameters
muteDetermines whether to play or stop playing the remote audio.
  • true: Stop playing the remote audio.
  • false: (Default) Play the remote audio.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getSpeakerMute()

virtual int agora::rtc::INGAudioDeviceManager::getSpeakerMute ( bool &  mute)
pure virtual

Gets the mute state of the speaker.

Parameters
muteA reference to the mute state of the speaker.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getPlayoutAudioParameters()

virtual int agora::rtc::INGAudioDeviceManager::getPlayoutAudioParameters ( AudioParameters params) const
pure virtual

Get the playout parameters of audio device.

Parameters
paramsA point to the struct AudioParameters.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getRecordAudioParameters()

virtual int agora::rtc::INGAudioDeviceManager::getRecordAudioParameters ( AudioParameters params) const
pure virtual

Get the record parameters of audio device.

Parameters
paramsA point to the struct AudioParameters.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setDefaultAudioRouting()

virtual int agora::rtc::INGAudioDeviceManager::setDefaultAudioRouting ( AudioRoute  route)
pure virtual

Sets the default audio routing.

This method allows apps to change the current audio route for the received audio. Noted: In Low Level API, we don't support default audio routing, i.e., setDefaultAudioRouteToSpeakerphone. This can be done in RTC engine.

Note
This method applies to Android and iOS only.
Parameters
routeThe default audio route. See AudioRoute.
Returns
  • 0: Success.
  • < 0: Failure.

◆ changeAudioRouting()

virtual int agora::rtc::INGAudioDeviceManager::changeAudioRouting ( AudioRoute  route)
pure virtual

Changes the current audio routing.

Note
This method applies to Android and iOS only.
Parameters
routeThe audio route that you want to change to. See AudioRoute.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getCurrentRouting()

virtual int agora::rtc::INGAudioDeviceManager::getCurrentRouting ( AudioRoute route)
pure virtual

Gets the current audio routing.

Note
This method applies to Android and iOS only.
Parameters
routeA reference to the audio route: AudioRoute.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getNumberOfPlayoutDevices()

virtual int agora::rtc::INGAudioDeviceManager::getNumberOfPlayoutDevices ( )
pure virtual

Gets the index numbers of all audio playout devices.

Note
This method applies to Windows or macOS only.
Returns
  • The index numbers of the audio playout devices: Success.
  • < 0: Failure.

◆ getNumberOfRecordingDevices()

virtual int agora::rtc::INGAudioDeviceManager::getNumberOfRecordingDevices ( )
pure virtual

Gets the index numbers of all audio recording devices.

Note
This method applies to Windows or macOS only.
Returns
  • The index numbers of the audio recording devices: Success.
  • < 0: Failure.

◆ getPlayoutDeviceInfo()

virtual AudioDeviceInfo agora::rtc::INGAudioDeviceManager::getPlayoutDeviceInfo ( int  index)
pure virtual

Gets the information of the current audio playout device.

Note
This method applies to Windows or macOS only.
Parameters
indexThe index number of the current audio playout device.
Returns
The information of the audio playout device. See AudioDeviceInfo.

◆ getRecordingDeviceInfo()

virtual AudioDeviceInfo agora::rtc::INGAudioDeviceManager::getRecordingDeviceInfo ( int  index)
pure virtual

Gets the information of the current recording device.

Note
This method applies to Windows or macOS only.
Parameters
indexThe index number of the current recording device.
Returns
The information of the recording device. See AudioDeviceInfo.

◆ setPlayoutDevice()

virtual int agora::rtc::INGAudioDeviceManager::setPlayoutDevice ( int  index)
pure virtual

Sets the audio playback device.

Note
This method applies to Windows or macOS only.
Parameters
indexThe index number of the audio playout device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRecordingDevice()

virtual int agora::rtc::INGAudioDeviceManager::setRecordingDevice ( int  index)
pure virtual

Sets the recording device.

Note
This method applies to Windows or macOS only.
Parameters
indexThe index number of the recording device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ followSystemPlaybackDevice()

virtual int agora::rtc::INGAudioDeviceManager::followSystemPlaybackDevice ( bool  enable)
pure virtual

The status of following system default playback device.

Note
The status of following system default playback device.
Parameters
enableVariable to whether the current device follow system default playback device or not.
  • true: The current device will change when the system default playback device changed.
  • false: The current device will change only current device is removed.
Returns
  • 0: Success.
  • < 0: Failure.

◆ followSystemRecordingDevice()

virtual int agora::rtc::INGAudioDeviceManager::followSystemRecordingDevice ( bool  enable)
pure virtual

The status of following system default recording device.

Note
The status of following system default recording device.
Parameters
enableVariable to whether the current device follow system default recording device or not.
  • true: The current device will change when the system default recording device changed.
  • false: The current device will change only current device is removed.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setApplicationVolume()

virtual int agora::rtc::INGAudioDeviceManager::setApplicationVolume ( unsigned int  volume)
pure virtual

Sets the volume of the app.

Note
This method applies to Windows only.
Parameters
volumeThe volume of the app. The value range is [0, 255].
Returns
  • 0: Success.
  • < 0: Failure.

◆ getApplicationVolume()

virtual int agora::rtc::INGAudioDeviceManager::getApplicationVolume ( unsigned int &  volume)
pure virtual

Gets the volume of the app.

Note
This method applies to Windows only.
Parameters
volumeThe volume of the app. The value range is [0, 255].
Returns
  • 0: Success.
  • < 0: Failure.

◆ setApplicationMuteState()

virtual int agora::rtc::INGAudioDeviceManager::setApplicationMuteState ( bool  mute)
pure virtual

Sets the mute state of the app.

Note
This method applies to Windows only.
Parameters
muteDetermines whether to set the app to the mute state.
  • true: Set the app to the mute state.
  • false: (Default) Do not set the app to the mute state.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getApplicationMuteState()

virtual int agora::rtc::INGAudioDeviceManager::getApplicationMuteState ( bool &  mute)
pure virtual

Gets the mute state of the app.

Note
This method applies to Windows only.
Parameters
muteA reference to the mute state of the app.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getLoopbackDeviceInfo()

virtual AudioDeviceInfo agora::rtc::INGAudioDeviceManager::getLoopbackDeviceInfo ( int  index)
pure virtual

Gets the information of the current audio loopback device.

Note
This method applies to Windows or macOS only.
Parameters
indexThe index number of the current audio playout device.
Returns
The information of the audio playout device. See AudioDeviceInfo.

◆ setLoopbackDevice()

virtual int agora::rtc::INGAudioDeviceManager::setLoopbackDevice ( int  index)
pure virtual

Sets the audio loopback device.

Note
This method applies to Windows only.
Parameters
indexThe index number of the audio playout device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ followSystemLoopbackDevice()

virtual int agora::rtc::INGAudioDeviceManager::followSystemLoopbackDevice ( bool  enable)
pure virtual

The status of following system default loopback device.

Note
The status of following system default loopback device.
Parameters
enableVariable to whether the current device follow system default loopback device or not.
  • true: The current device will change when the system default loopback device changed.
  • false: The current device will change only current device is removed.
Returns
  • 0: Success.
  • < 0: Failure.

◆ registerObserver()

virtual int agora::rtc::INGAudioDeviceManager::registerObserver ( IAudioDeviceManagerObserver observer,
void(*)(IAudioDeviceManagerObserver *)  safeDeleter = NULL 
)
pure virtual

Registers an IAudioDeviceManagerObserver object.

You need to implement the IAudioDeviceManageObserver class in this method, and register callbacks according to your scenario.

Parameters
observerA pointer to the IAudioDeviceManagerObserver class.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterObserver()

virtual int agora::rtc::INGAudioDeviceManager::unregisterObserver ( IAudioDeviceManagerObserver observer)
pure virtual

Releases the IAudioDeviceManagerObserver object.

Parameters
observerThe pointer to the IAudioDeviceManagerObserver class registered using registerObserver.
Returns
  • 0: Success.
  • < 0: Failure.