Audio device management methods.
The IAudioDeviceManager interface class allows for audio device interface testing. Instantiate an AAudioDeviceManager class to retrieve the IAudioDeviceManager interface.
◆ ~IAudioDeviceManager()
virtual agora::rtc::IAudioDeviceManager::~IAudioDeviceManager |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ enumeratePlaybackDevices()
Enumerates the audio playback devices.
This method returns an IAudioDeviceCollection object that includes all audio playback devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio playback devices.
- Note
- The application must call the release method to release the returned object after using it.
- Returns
- Success: Returns an IAudioDeviceCollection object that includes all audio playback devices in the system. For wireless Bluetooth headset devices with master and slave headsets, the master headset is the playback device.
- Returns NULL: Failure.
◆ enumerateRecordingDevices()
Enumerates the audio recording devices.
This method returns an IAudioDeviceCollection object that includes all audio recording devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio recording devices.
- Note
- The application needs to call the release method to release the returned object after using it.
- Returns
- Returns an IAudioDeviceCollection object that includes all audio recording devices in the system: Success.
- Returns NULL: Failure.
◆ setPlaybackDevice()
virtual int agora::rtc::IAudioDeviceManager::setPlaybackDevice |
( |
const char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Sets the audio playback device using the device ID.
- Note
- Plugging or unplugging the audio device does not change the device ID.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDevice()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDevice |
( |
const char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Sets the audio recording device using the device ID.
- Parameters
-
- Note
- Plugging or unplugging the audio device does not change the device ID.
- Returns
- 0: Success.
- < 0: Failure.
◆ startPlaybackDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::startPlaybackDeviceTest |
( |
const char * |
testAudioFilePath | ) |
|
|
pure virtual |
Starts the audio playback device test.
This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.
- Parameters
-
testAudioFilePath | Pointer to the path of the audio file for the audio playback device test in UTF-8:
- Supported file formats: wav, mp3, m4a, and aac.
- Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
|
- Returns
- 0: Success, and you can hear the sound of the specified audio file.
- < 0: Failure.
◆ stopPlaybackDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::stopPlaybackDeviceTest |
( |
| ) |
|
|
pure virtual |
Stops the audio playback device test.
This method stops testing the audio playback device. You must call this method to stop the test after calling the startPlaybackDeviceTest method.
- Returns
- 0: Success.
- < 0: Failure.
◆ setPlaybackDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::setPlaybackDeviceVolume |
( |
int |
volume | ) |
|
|
pure virtual |
Sets the volume of the audio playback device.
- Parameters
-
volume | Sets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). |
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDeviceVolume |
( |
int * |
volume | ) |
|
|
pure virtual |
Retrieves the volume of the audio playback device.
- Parameters
-
volume | Pointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). |
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDeviceVolume |
( |
int |
volume | ) |
|
|
pure virtual |
Sets the volume of the microphone.
- Parameters
-
volume | Sets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume). |
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDeviceVolume |
( |
int * |
volume | ) |
|
|
pure virtual |
Retrieves the volume of the microphone.
- Parameters
-
volume | Pointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). |
- Returns
- 0: Success.
- < 0: Failure.
◆ setPlaybackDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::setPlaybackDeviceMute |
( |
bool |
mute | ) |
|
|
pure virtual |
Mutes the audio playback device.
- Parameters
-
mute | Sets whether to mute/unmute the audio playback device:
- true: Mutes.
- false: Unmutes.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDeviceMute |
( |
bool * |
mute | ) |
|
|
pure virtual |
Retrieves the mute status of the audio playback device.
- Parameters
-
mute | Pointer to whether the audio playback device is muted/unmuted.
- true: Muted.
- false: Unmuted.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDeviceMute |
( |
bool |
mute | ) |
|
|
pure virtual |
Mutes/Unmutes the microphone.
- Parameters
-
mute | Sets whether to mute/unmute the microphone:
- true: Mutes.
- false: Unmutes.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDeviceMute |
( |
bool * |
mute | ) |
|
|
pure virtual |
Retrieves the microphone's mute status.
- Parameters
-
mute | Pointer to whether the microphone is muted/unmuted.
- true: Muted.
- false: Unmuted.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ startRecordingDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::startRecordingDeviceTest |
( |
int |
indicationInterval | ) |
|
|
pure virtual |
Starts the microphone test.
This method tests whether the microphone works properly. Once the test starts, the SDK uses the onAudioVolumeIndication callback to notify the application with the volume information.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ stopRecordingDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::stopRecordingDeviceTest |
( |
| ) |
|
|
pure virtual |
Stops the microphone test.
This method stops the microphone test. You must call this method to stop the test after calling the startRecordingDeviceTest method.
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDevice()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDevice |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Retrieves the audio playback device associated with the device ID.
- Parameters
-
deviceId | Pointer to the ID of the audio playback device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDeviceInfo()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDeviceInfo |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH], |
|
|
char |
deviceName[MAX_DEVICE_ID_LENGTH] |
|
) |
| |
|
pure virtual |
Retrieves the audio playback device information associated with the device ID and device name.
- Parameters
-
deviceId | Pointer to the device ID of the audio playback device. |
deviceName | Pointer to the device name of the audio playback device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDevice()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDevice |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Retrieves the audio recording device associated with the device ID.
- Parameters
-
deviceId | Pointer to the device ID of the audio recording device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDeviceInfo()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDeviceInfo |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH], |
|
|
char |
deviceName[MAX_DEVICE_ID_LENGTH] |
|
) |
| |
|
pure virtual |
Retrieves the audio recording device information associated with the device ID and device name.
- Parameters
-
deviceId | Pointer to the device ID of the recording audio device. |
deviceName | Pointer to the device name of the recording audio device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ startAudioDeviceLoopbackTest()
virtual int agora::rtc::IAudioDeviceManager::startAudioDeviceLoopbackTest |
( |
int |
indicationInterval | ) |
|
|
pure virtual |
Starts the audio device loopback test.
This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The onAudioVolumeIndication callback returns the local audio volume information at the set interval.
- Note
- This method tests the local audio devices and does not report the network conditions.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ stopAudioDeviceLoopbackTest()
virtual int agora::rtc::IAudioDeviceManager::stopAudioDeviceLoopbackTest |
( |
| ) |
|
|
pure virtual |
Stops the audio device loopback test.
- Note
- Ensure that you call this method to stop the loopback test after calling the startAudioDeviceLoopbackTest method.
- Returns
- 0: Success.
- < 0: Failure.
◆ release()
virtual void agora::rtc::IAudioDeviceManager::release |
( |
| ) |
|
|
pure virtual |