Video SDK v3.7.1 API Reference for All Platforms (C++)
agora::rtc::IAudioDeviceCollection Class Referenceabstract

Public Member Functions

virtual int getCount ()=0
 
virtual int getDevice (int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH])=0
 
virtual int setDevice (const char deviceId[MAX_DEVICE_ID_LENGTH])=0
 
virtual int getDefaultDevice (char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH])=0
 
virtual int setApplicationVolume (int volume)=0
 
virtual int getApplicationVolume (int &volume)=0
 
virtual int setApplicationMute (bool mute)=0
 
virtual int isApplicationMute (bool &mute)=0
 
virtual void release ()=0
 

Protected Member Functions

virtual ~IAudioDeviceCollection ()
 

Detailed Description

Audio device collection methods.

The IAudioDeviceCollection interface class gets device-related information.

Constructor & Destructor Documentation

◆ ~IAudioDeviceCollection()

virtual agora::rtc::IAudioDeviceCollection::~IAudioDeviceCollection ( )
inlineprotectedvirtual

Member Function Documentation

◆ getCount()

virtual int agora::rtc::IAudioDeviceCollection::getCount ( )
pure virtual

Gets the total number of audio playback or audio capturing devices (for macOS and Windows only).

Note
You must first call the enumeratePlaybackDevices or enumerateRecordingDevices method before calling this method to return the number of audio playback or audio capturing devices.
Returns
Number of audio playback or audio capturing devices.

◆ getDevice()

virtual int agora::rtc::IAudioDeviceCollection::getDevice ( int  index,
char  deviceName[MAX_DEVICE_ID_LENGTH],
char  deviceId[MAX_DEVICE_ID_LENGTH] 
)
pure virtual

Gets a specified piece of information about an indexed audio device (for macOS and Windows only).

Parameters
indexThe specified index that must be less than the return value of getCount.
deviceNamePointer to the audio device name.
deviceIdPointer to the audio device ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setDevice()

virtual int agora::rtc::IAudioDeviceCollection::setDevice ( const char  deviceId[MAX_DEVICE_ID_LENGTH])
pure virtual

Specifies a device with the device ID (for macOS and Windows only).

Parameters
deviceIdPointer to the device ID of the device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getDefaultDevice()

virtual int agora::rtc::IAudioDeviceCollection::getDefaultDevice ( char  deviceName[MAX_DEVICE_ID_LENGTH],
char  deviceId[MAX_DEVICE_ID_LENGTH] 
)
pure virtual

Gets the default audio device of the system (for macOS and Windows only).

Since
v3.6.0
Parameters
deviceNameThe name of the system default audio device.
deviceIdThe device ID of the the system default audio device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setApplicationVolume()

virtual int agora::rtc::IAudioDeviceCollection::setApplicationVolume ( int  volume)
pure virtual

Sets the volume of the application (for macOS and Windows only).

Parameters
volumeApplication volume. The value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • < 0: Failure.

◆ getApplicationVolume()

virtual int agora::rtc::IAudioDeviceCollection::getApplicationVolume ( int &  volume)
pure virtual

Gets the volume of the application (for macOS and Windows only).

Parameters
volumePointer to the application volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • < 0: Failure.

◆ setApplicationMute()

virtual int agora::rtc::IAudioDeviceCollection::setApplicationMute ( bool  mute)
pure virtual

Mutes the application (for macOS and Windows only).

Parameters
muteSets whether to mute/unmute the application:
  • true: Mute the application.
  • false: Unmute the application.
Returns
  • 0: Success.
  • < 0: Failure.

◆ isApplicationMute()

virtual int agora::rtc::IAudioDeviceCollection::isApplicationMute ( bool &  mute)
pure virtual

Gets the mute state of the application (for macOS and Windows only).

Parameters
mutePointer to whether the application is muted/unmuted.
  • true: The application is muted.
  • false: The application is not muted.
Returns
  • 0: Success.
  • < 0: Failure.

◆ release()

virtual void agora::rtc::IAudioDeviceCollection::release ( )
pure virtual

Releases all IAudioDeviceCollection resources (for macOS and Windows only).