Public Member Functions

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)
 

Detailed Description

Callbacks of the raw audio data (IAudioFrameObserver).

Member Function Documentation

◆ 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
samplesSampling data of the frame.
numOfSamplesNumber of samples.
bytesPerSampleNumber of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes).
channelsNumber of audio channels. If the channel uses stereo, the data is interleaved.
  • 1: Mono
  • 2: Stereo
samplesPerSecSampling rate per second for 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
samplesSampling data of the frame.
numOfSamplesNumber of samples.
bytesPerSampleNumber of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes).
channelsNumber of audio channels. If the channel uses stereo, the data is interleaved.
  • 1: Mono
  • 2: Stereo
samplesPerSecSampling rate per second for 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.

The documentation for this interface was generated from the following file:
  • src/main/java/io/agora/rtc/IAudioFrameObserver.java