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:

## Public Member Functions
virtual agora_refptr< IRecordingDeviceSource > | createRecordingDeviceSource (char deviceId[kAdmMaxDeviceNameSize])=0
virtual int | setMicrophoneVolume (unsigned int volume, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | getMicrophoneVolume (unsigned int &volume)=0
virtual int | setSpeakerVolume (unsigned int volume, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | getSpeakerVolume (unsigned int &volume)=0
virtual int | setMicrophoneMute (bool mute, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | getMicrophoneMute (bool &mute)=0
virtual int | setSpeakerMute (bool mute, aosl_ref_t ares=AOSL_REF_INVALID)=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, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | unregisterObserver (IAudioDeviceManagerObserver *observer)=0
virtual int | setupAudioAttributeContext (void *audioAttr, aosl_ref_t ares=AOSL_REF_INVALID)=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
  - The pointer to IRecordingDeviceSource, if the method call succeeds.
  - An empty pointer NULL: Failure.

## ◆ setMicrophoneVolume()

virtual int agora::rtc::INGAudioDeviceManager::setMicrophoneVolume | ( | unsigned int | volume,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Sets the volume of the microphone.

Parameters

  volume | The 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

  volume | The volume of the microphone.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setSpeakerVolume()

virtual int agora::rtc::INGAudioDeviceManager::setSpeakerVolume | ( | unsigned int | volume,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Sets the volume of the speaker.

Parameters

  volume | The 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

  volume | The volume of the speaker.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setMicrophoneMute()

virtual int agora::rtc::INGAudioDeviceManager::setMicrophoneMute | ( | bool | mute,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Captures or stops capturing the local audio with the microphone.

Parameters

  mute | Determines 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

  mute | The mute state of the microphone.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setSpeakerMute()

virtual int agora::rtc::INGAudioDeviceManager::setSpeakerMute | ( | bool | mute,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Plays or stops playing the remote audio with the speaker.

Parameters

  mute | Determines 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

  mute | A 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

  params | A 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

  params | A point to the struct AudioParameters.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ registerObserver()

virtual int agora::rtc::INGAudioDeviceManager::registerObserver | ( | IAudioDeviceManagerObserver * | observer,
|  | void(*)(IAudioDeviceManagerObserver *) | safeDeleter = `NULL`,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Registers an IAudioDeviceManagerObserver object.

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

Parameters

  observer | A 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

  observer | The pointer to the IAudioDeviceManagerObserver class registered using registerObserver.

Returns
  - 0: Success.
  - < 0: Failure.