#include <IAgoraRtcEngine.h>
◆ enumeratePlaybackDevices()
Enumerates the audio playback devices.
This method returns an IAudioDeviceCollection object that includes all the audio playback devices in the system. With the IAudioDeviceCollection object, the app can enumerate the audio playback devices. The app must call the IAudioDeviceCollection::release method to release the returned object after using it.
- Returns
- A pointer to the IAudioDeviceCollection object that includes all the audio playback devices in the system, if the method call succeeds.
- The empty pointer NULL, if the method call fails.
◆ enumerateRecordingDevices()
Enumerates the audio recording devices.
This method returns an IAudioDeviceCollection object that includes all the audio recording devices in the system. With the IAudioDeviceCollection object, the app can enumerate the audio recording devices. The app needs to call the IAudioDeviceCollection::release method to release the returned object after using it.
- Returns
- A pointer to the IAudioDeviceCollection object that includes all the audio recording devices in the system, if the method call succeeds.
- The empty pointer NULL, if the method call fails.
◆ setPlaybackDevice()
virtual int agora::rtc::IAudioDeviceManager::setPlaybackDevice |
( |
const char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Specifies an audio playback device with the device ID.
- Parameters
-
deviceId | ID of the audio playback device. It can be retrieved by the enumeratePlaybackDevices method. Plugging or unplugging the audio device does not change the device ID. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDevice()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDevice |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Gets the ID of the audio playback device.
- Parameters
-
deviceId | An output parameter that specifies 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 |
Gets the device ID and device name of the audio playback device.
- Parameters
-
deviceId | An output parameter that specifies the ID of the audio playback device. |
deviceName | An output parameter that specifies the name of the audio playback device. |
- 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 | The volume of the audio playing device. The value range is [0, 255]. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDeviceVolume |
( |
int * |
volume | ) |
|
|
pure virtual |
Gets the volume of the audio playback device.
- Parameters
-
volume | The volume of the audio playback device. The value range is [0, 255]. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDevice()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDevice |
( |
const char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Specifies an audio recording device with the device ID.
- Parameters
-
deviceId | ID of the audio recording device. It can be retrieved by the enumerateRecordingDevices method. Plugging or unplugging the audio device does not change the device ID. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDevice()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDevice |
( |
char |
deviceId[MAX_DEVICE_ID_LENGTH] | ) |
|
|
pure virtual |
Gets the audio recording device by the device ID.
- Parameters
-
deviceId | 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 |
Gets the information of the audio recording device by the device ID and device name.
- Parameters
-
deviceId | ID of the audio recording device. |
deviceName | The name of the audio recording device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDeviceVolume |
( |
int |
volume | ) |
|
|
pure virtual |
Sets the volume of the recording device.
- Parameters
-
volume | The volume of the recording device. The value range is [0, 255]. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDeviceVolume()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDeviceVolume |
( |
int * |
volume | ) |
|
|
pure virtual |
Gets the volume of the recording device.
- Parameters
-
volume | The volume of the microphone, ranging from 0 to 255. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setPlaybackDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::setPlaybackDeviceMute |
( |
bool |
mute | ) |
|
|
pure virtual |
Mutes or unmutes the audio playback device.
- Parameters
-
mute | Determines whether to mute the audio playback device.
- true: Mute the device.
- false: Unmute the device.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ getPlaybackDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::getPlaybackDeviceMute |
( |
bool * |
mute | ) |
|
|
pure virtual |
Gets the mute state of the playback device.
- Parameters
-
mute | A pointer to the mute state of the playback device.
- true: The playback device is muted.
- false: The playback device is unmuted.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ setRecordingDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::setRecordingDeviceMute |
( |
bool |
mute | ) |
|
|
pure virtual |
Mutes or unmutes the audio recording device.
- Parameters
-
mute | Determines whether to mute the recording device.
- true: Mute the microphone.
- false: Unmute the microphone.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ getRecordingDeviceMute()
virtual int agora::rtc::IAudioDeviceManager::getRecordingDeviceMute |
( |
bool * |
mute | ) |
|
|
pure virtual |
Gets the mute state of the audio recording device.
- Parameters
-
mute | A pointer to the mute state of the recording device.
- true: The microphone is muted.
- false: The microphone is unmuted.
|
- 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 hears the audio, the playback device works properly.
- Parameters
-
testAudioFilePath | The file path of the audio file for the test, which is an absolute path in UTF8:
- Supported file format: wav, mp3, m4a, and aac.
- Supported file sampling rate: 8000, 16000, 32000, 44100, and 48000.
|
- Returns
- 0, if the method call succeeds and you can hear the sound of the specified audio file.
- An error code, if the method call fails.
◆ stopPlaybackDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::stopPlaybackDeviceTest |
( |
| ) |
|
|
pure virtual |
Stops the audio playback device test.
- Returns
- 0: Success.
- < 0: Failure.
◆ startRecordingDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::startRecordingDeviceTest |
( |
int |
indicationInterval | ) |
|
|
pure virtual |
Starts the recording device test.
This method tests whether the recording device works properly. Once the test starts, the SDK uses the onAudioVolumeIndication callback to notify the app on the volume information.
- Parameters
-
indicationInterval | The time interval (ms) between which the SDK triggers the onAudioVolumeIndication callback. |
- Returns
- 0: Success.
- < 0: Failure.
◆ stopRecordingDeviceTest()
virtual int agora::rtc::IAudioDeviceManager::stopRecordingDeviceTest |
( |
| ) |
|
|
pure virtual |
Stops the recording device test.
- 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, and 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 |