|
abstract boolean | onRecordFrame (byte[] samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec) |
|
abstract boolean | onPlaybackFrame (byte[] samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec) |
|
◆ onRecordFrame()
abstract boolean io.agora.rtc.IAudioFrameObserver.onRecordFrame |
( |
byte [] |
samples, |
|
|
int |
numOfSamples, |
|
|
int |
bytesPerSample, |
|
|
int |
channels, |
|
|
int |
samplesPerSec |
|
) |
| |
|
abstract |
10 ms 自动回调:获得录制的声音。
- 参数
-
samples | 该帧的采样数据 |
numOfSamples | 采样数 |
bytesPerSample | 每个样本的字节数:对于 PCM 来说,一般使用 16 bit,即两个字节 |
channels | 频道数量(如果是立体声,数据是交叉的)
|
samplesPerSec | 每秒采样点数,samplesPerCall = (int)(samplesPerSec × sampleInterval × numChannels),其中 sampleInterval ≥ 0.01,单位为秒 |
- 返回
-
true: 客户提供的数据有效,将被编码发送。
-
false: 客户提供的数据无效,不会被编码发送而会被直接抛弃。
◆ onPlaybackFrame()
abstract boolean io.agora.rtc.IAudioFrameObserver.onPlaybackFrame |
( |
byte [] |
samples, |
|
|
int |
numOfSamples, |
|
|
int |
bytesPerSample, |
|
|
int |
channels, |
|
|
int |
samplesPerSec |
|
) |
| |
|
abstract |
10 ms 自动回调:获得播放的声音。
- 参数
-
samples | 该帧的采样数据 |
numOfSamples | 采样数 |
bytesPerSample | 每个样本的字节数:对于 PCM 来说,一般使用 16 bit,即两个字节 |
channels | 频道数量(如果是立体声,数据是交叉的)
|
samplesPerSec | 每秒采样点数,samplesPerCall = (int)(samplesPerSec × sampleInterval × numChannels),其中 sampleInterval ≥ 0.01,单位为秒 |
- 返回
-
true: 客户提供的数据有效,将被编码发送。
-
false: 客户提供的数据无效,不会被编码发送而会被直接抛弃。