继承自 agora_gaming_rtc.IAudioPlaybackDeviceManager .
◆ CreateAAudioPlaybackDeviceManager()
override bool agora_gaming_rtc.AudioPlaybackDeviceManager.CreateAAudioPlaybackDeviceManager |
( |
| ) |
|
◆ ReleaseAAudioPlaybackDeviceManager()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.ReleaseAAudioPlaybackDeviceManager |
( |
| ) |
|
◆ GetAudioPlaybackDeviceCount()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceCount |
( |
| ) |
|
获取系统中被索引的音频播放设备的总数。
- 返回
- 被索引的音频播放设备的总数。
◆ GetAudioPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDevice |
( |
int |
index, |
|
|
ref string |
deviceName, |
|
|
ref string |
deviceId |
|
) |
| |
获取某个被索引的音频播放设备的指定信息。
调用该方法后,SDK 会根据索引获取音频播放设备的设备名称和设备 ID。
- 注解
- 在 GetAudioPlaybackDeviceCount 方法后调用该方法。
- 参数
-
index | 指定的索引值,必须小于 GetAudioPlaybackDeviceCount 的返回值。 |
deviceName | 设备名称。 |
deviceId | 设备 ID。 |
- 返回
-
◆ GetCurrentPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDevice |
( |
ref string |
deviceId | ) |
|
◆ SetAudioPlaybackDevice()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDevice |
( |
string |
deviceId | ) |
|
通过设备 ID 设置指定的音频播放设备。
- 注解
-
- 参数
-
deviceId | 设备 ID,可通过 GetAudioPlaybackDevice 获取。 |
- 返回
-
◆ SetAudioPlaybackDeviceVolume()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceVolume |
( |
int |
volume | ) |
|
设置音频播放设备音量。
- 参数
-
volume | 音频播放设备音量。取值可在 [0,255]。 |
- 返回
-
◆ GetAudioPlaybackDeviceVolume()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceVolume |
( |
| ) |
|
获取当前音频播放设备的音量。
- 返回
- ≥ 0: 方法调用成功则返回当前音频播放设备的音量。
- < 0: 方法调用失败。
◆ SetAudioPlaybackDeviceMute()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceMute |
( |
bool |
mute | ) |
|
◆ IsAudioPlaybackDeviceMute()
override bool agora_gaming_rtc.AudioPlaybackDeviceManager.IsAudioPlaybackDeviceMute |
( |
| ) |
|
获取当前音频播放设备的静音状态。
- 返回
- 当前音频播放设备的静音状态。
- true: 为静音状态;
- false: 为非静音状态。
◆ StartAudioPlaybackDeviceTest()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.StartAudioPlaybackDeviceTest |
( |
string |
testAudioFilePath | ) |
|
启动音频播放设备测试。
该方法测试音频播放设备是否能正常工作。启动测试后,SDK 播放指定的音频文件,测试者如果能听到声音,说明音频播放设备能正常工作。
调用该方法后,SDK 会每隔 100 ms 触发一次 OnVolumeIndicationHandler 回调,报告 uid = 1
及播放设备的音量信息。测试完成后,你需要调用 StopAudioPlaybackDeviceTest 停止测试。
- 注解
- 该方法需在加入频道前调用。
- 该方法仅适用于 Windows 和 macOS 平台。
- 参数
-
testAudioFilePath | 音频文件的绝对路径,路径字符串使用 UTF-8 编码格式。
- 支持文件格式: wav、mp3、m4a、aac;
- 支持文件采样率: 8000、16000、32000、44100、48000。
|
- 返回
- 0: 方法调用成功,测试者可以听到声音。
- < 0: 方法调用失败。
◆ StopAudioPlaybackDeviceTest()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.StopAudioPlaybackDeviceTest |
( |
| ) |
|
◆ GetCurrentPlaybackDeviceInfo()
override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDeviceInfo |
( |
ref string |
deviceName, |
|
|
ref string |
deviceId |
|
) |
| |
获取当前音频播放设备的信息。
- 参数
-
deviceName | 当前播放设备的设备名称。 |
deviceId | 当前播放设备的设备 ID。 |
- 返回
-