Developer Center
Interactive Live Streaming Premium
API Reference
Agora Java API Reference for Android
Agora Java API Reference for Android
|
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) |
|
Callbacks of the raw audio data (IAudioFrameObserver).
◆ onRecordFrame()
abstract boolean io.agora.rtc.IAudioFrameObserver.onRecordFrame |
( |
byte [] |
samples, |
|
|
int |
numOfSamples, |
|
|
int |
bytesPerSample, |
|
|
int |
channels, |
|
|
int |
samplesPerSec |
|
) |
| |
|
abstract |
Occurs when the recorded audio frame is received.
- Parameters
-
samples | Sample data of the frame. |
numOfSamples | Number of samples. |
bytesPerSample | Number of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes). |
channels | Number of audio channels. If the channel uses stereo, the data is interleaved.
|
samplesPerSec | The number of samples per channel per second in the audio frame. |
- Returns
-
true: The recorded audio frame is valid and is encoded and sent.
-
false: The recorded audio frame is invalid and is not encoded or sent.
◆ onPlaybackFrame()
abstract boolean io.agora.rtc.IAudioFrameObserver.onPlaybackFrame |
( |
byte [] |
samples, |
|
|
int |
numOfSamples, |
|
|
int |
bytesPerSample, |
|
|
int |
channels, |
|
|
int |
samplesPerSec |
|
) |
| |
|
abstract |
Occurs when the playback audio frame is received.
- Parameters
-
samples | Sample data of the frame. |
numOfSamples | Number of samples. |
bytesPerSample | Number of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes). |
channels | Number of audio channels. If the channel uses stereo, the data is interleaved.
|
samplesPerSec | The number of samples per channel per second in the audio frame. |
- Returns
-
true: The playback audio frame is valid and is encoded and sent.
-
false: The playback audio frame is invalid and is not encoded or sent.