继承自 agora_gaming_rtc.IAudioRawDataManager .
◆ OnRecordAudioFrameHandler()
delegate void agora_gaming_rtc.AudioRawDataManager.OnRecordAudioFrameHandler |
( |
AudioFrame |
audioFrame | ) |
|
◆ OnPlaybackAudioFrameHandler()
delegate void agora_gaming_rtc.AudioRawDataManager.OnPlaybackAudioFrameHandler |
( |
AudioFrame |
audioFrame | ) |
|
◆ OnMixedAudioFrameHandler()
delegate void agora_gaming_rtc.AudioRawDataManager.OnMixedAudioFrameHandler |
( |
AudioFrame |
audioFrame | ) |
|
10 ms 自动回调:获取采集和播放语音混音后的数据。
- 注解
- 该方法仅返回单通道数据。
- 参数
-
◆ OnPlaybackAudioFrameBeforeMixingHandler()
delegate void agora_gaming_rtc.AudioRawDataManager.OnPlaybackAudioFrameBeforeMixingHandler |
( |
uint |
uid, |
|
|
AudioFrame |
audioFrame |
|
) |
| |
10 ms 自动回调:获得混音前的指定用户的声音。
- 参数
-
◆ SetOnRecordAudioFrameCallback()
◆ SetOnPlaybackAudioFrameCallback()
◆ SetOnMixedAudioFrameCallback()
◆ SetOnPlaybackAudioFrameBeforeMixingCallback()
◆ RegisterAudioRawDataObserver()
override int agora_gaming_rtc.AudioRawDataManager.RegisterAudioRawDataObserver |
( |
| ) |
|
注册原始音频数据观测器。
- 注解
- 该方法需要在加入频道前调用。
- 返回
-
◆ UnRegisterAudioRawDataObserver()
override int agora_gaming_rtc.AudioRawDataManager.UnRegisterAudioRawDataObserver |
( |
| ) |
|
◆ PullAudioFrame()
override int agora_gaming_rtc.AudioRawDataManager.PullAudioFrame |
( |
IntPtr |
audioBuffer, |
|
|
int |
type, |
|
|
int |
samples, |
|
|
int |
bytesPerSample, |
|
|
int |
channels, |
|
|
int |
samplesPerSec, |
|
|
long |
renderTimeMs, |
|
|
int |
avsync_type |
|
) |
| |
拉取远端音频数据。
使用该方法前,你需要调用 SetExternalAudioSink(enabled: true) 方法通知 app 开启并设置外部渲染。
调用该方法后,app 会采取主动拉取的方式获取远端已解码和混音后的音频数据,用于音频播放。
- 注解
- 使用该方法后,app 会无法从 OnPlaybackAudioFrameHandler 回调中获得数据。
- 该方法和
OnPlaybackAudioFrameHandler
回调相比,区别在于:
OnPlaybackAudioFrameHandler
: SDK 通过该回调将音频数据传输给 app。如果 app 处理延时,可能会导致音频播放抖动。
PullAudioFrame
: app 主动拉取音频数据。通过设置音频数据,SDK 可以调整缓存,帮助 app 处理延时,从而有效避免音频播放抖动。
- 参数
-
audioBuffer | 声音数据缓存区(如果是立体声,数据是交叉存储的)。缓存区数据大小:buffer = samples × channels × bytesPerSample 。 |
type | 音频帧类型。详见 AUDIO_FRAME_TYPE 。 |
samples | 每个声道的采样点数。 |
bytesPerSample | 每个采样点的字节数。通常为十六位,即两个字节。 |
channels | 声道数量(如果是立体声,数据是交叉的)
|
samplesPerSec | 采样率。 |
renderTimeMs | 外部音频帧的渲染时间戳。你可以使用该时间戳还原音频帧顺序;在有视频的场景中(包含使用外部视频源的场景),该参数可以用于实现音视频同步。 |
avsync_type | 预留参数。 |
- 返回
-