Inherits agora_gaming_rtc.IAudioPlaybackDeviceManager.
The definition of AudioPlaybackDeviceManager. The APIs of this class are only available on Windows and macOS.
◆ CreateAAudioPlaybackDeviceManager()
override bool agora_gaming_rtc.AudioPlaybackDeviceManager.CreateAAudioPlaybackDeviceManager |
( |
| ) |
|
◆ ReleaseAAudioPlaybackDeviceManager()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.ReleaseAAudioPlaybackDeviceManager |
( |
| ) |
|
◆ GetAudioPlaybackDeviceCount()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceCount |
( |
| ) |
|
Retrieves the total number of the indexed audio playback devices in the system.
- Returns
- Total number of the indexed audio playback devices.
◆ GetAudioPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDevice |
( |
int |
index, |
|
|
ref string |
deviceName, |
|
|
ref string |
deviceId |
|
) |
| |
Retrieves the audio playback device associated with the index.
After calling this method, the SDK retrieves the device name and device ID according to the index.
- Note
- Call GetAudioPlaybackDeviceCount before this method.
- Parameters
-
index | The index of the playback device in the system. The value of index is associated with the number of the playback device which is retrieved from GetAudioPlaybackDeviceCount . For example, when the number of playback devices is 3, the value range of index is [0,2]. |
deviceName | The name of the playback device for the corresponding index. |
deviceId | The ID of the playback device for the corresponding index. |
- Returns
- 0: Success.
- < 0: Failure.
◆ GetCurrentPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDevice |
( |
ref string |
deviceId | ) |
|
Retrieves the device ID of the current audio playback device.
- Parameters
-
deviceId | The device ID of the current audio playback device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ SetAudioPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDevice |
( |
string |
deviceId | ) |
|
Sets the audio playback device using the device ID.
- Note
- Call GetAudioPlaybackDevice before this method.
- Plugging or unplugging the audio device does not change the device ID.
- Parameters
-
deviceId | Device ID of the audio playback device, retrieved by calling GetAudioPlaybackDevice . |
- Returns
- 0: Success.
- < 0: Failure.
◆ GetAudioPlaybackDefaultDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDefaultDevice |
( |
ref string |
deviceName, |
|
|
ref string |
deviceId |
|
) |
| |
Gets the default audio playback device of the system.
- Since
- v3.6.1.1
- Parameters
-
deviceName | The name of the system default audio device. |
deviceId | The device ID of the the system default audio device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ SetAudioPlaybackDeviceVolume()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceVolume |
( |
int |
volume | ) |
|
Sets the volume of the current audio playback device.
- Parameters
-
volume | The volume of the current audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). |
- Returns
- 0: Success.
- < 0: Failure.
◆ GetAudioPlaybackDeviceVolume()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceVolume |
( |
| ) |
|
Retrieves the volume of the current audio playback device.
- Returns
- The volume of the current audio playback device, if this method call succeeds.
- < 0: Failure.
◆ SetAudioPlaybackDeviceMute()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceMute |
( |
bool |
mute | ) |
|
Sets whether to stop audio playback.
- Parameters
-
mute | Sets whether to stop audio playback.
- true: Stops.
- false: Doesn't stop.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ IsAudioPlaybackDeviceMute()
override bool agora_gaming_rtc.AudioPlaybackDeviceManager.IsAudioPlaybackDeviceMute |
( |
| ) |
|
Retrieves the status of the current audio playback device.
- Returns
- Whether the current audio playback device stops audio playback.
- true: Stops.
- false: Doesn't stop.
◆ StartAudioPlaybackDeviceTest()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.StartAudioPlaybackDeviceTest |
( |
string |
testAudioFilePath | ) |
|
Starts the test of the current audio playback device.
This method tests whether the audio playback device works properly. Once a user starts the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.
After calling this method, the SDK triggers the OnVolumeIndicationHandler callback every 100 ms, which reports uid = 1
and the volume of the playback device.
- Note
- Ensure that you call StopAudioPlaybackDeviceTest after calling this method.
- Call this method before joining a channel.
- This method is for Windows and macOS only.
- Parameters
-
testAudioFilePath | 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.
◆ StopAudioPlaybackDeviceTest()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.StopAudioPlaybackDeviceTest |
( |
| ) |
|
Stops the test of the current audio playback device.
- Note
- Ensure that you call this method to stop the test after calling StartAudioPlaybackDeviceTest.
- Returns
- 0: Success.
- < 0: Failure.
◆ FollowSystemPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.FollowSystemPlaybackDevice |
( |
bool |
enable | ) |
|
Sets the audio playback device used by the SDK to follow the system default audio playback device.
- Since
- v3.6.1.1
- Parameters
-
enable | Whether to follow the system default audio playback device:
- true: Follow. The SDK immediately switches the audio playback device when the system default audio playback device changes.
- false: Do not follow. The SDK switches the audio playback device to the system default audio playback device only when the currently used audio playback device is disconnected.
|
- Returns
- 0: Success.
- < 0: Failure.
◆ GetCurrentPlaybackDeviceInfo()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDeviceInfo |
( |
ref string |
deviceName, |
|
|
ref string |
deviceId |
|
) |
| |
Retrieves the device information of the current audio playback device.
- Parameters
-
deviceName | The device name of the current audio playback device. |
deviceId | The device ID of the current audio playback device. |
- Returns
- 0: Success.
- < 0: Failure.