Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtc::INGAudioDeviceManager Class Referenceabstract

#include <NGIAgoraAudioDeviceManager.h>

Inheritance diagram for agora::rtc::INGAudioDeviceManager:
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 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
 

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.

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.

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