Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc2.IAudioEncodedFrameObserver Interface Reference

Public Member Functions

abstract void onRecordAudioEncodedFrame (ByteBuffer buffer, int samplesPerChannel, int channels, int samplesPerSec, int codecType)
 Gets the encoded audio data of the local user. More...
 
abstract void onPlaybackAudioEncodedFrame (ByteBuffer buffer, int samplesPerChannel, int channels, int samplesPerSec, int codecType)
 Gets the encoded audio data of all remote users. More...
 
abstract void onMixedAudioEncodedFrame (ByteBuffer buffer, int samplesPerChannel, int channels, int samplesPerSec, int codecType)
 Gets the mixed and encoded audio data of the local and all remote users. More...
 

Member Function Documentation

◆ onRecordAudioEncodedFrame()

abstract void io.agora.rtc2.IAudioEncodedFrameObserver.onRecordAudioEncodedFrame ( ByteBuffer  buffer,
int  samplesPerChannel,
int  channels,
int  samplesPerSec,
int  codecType 
)
abstract

Gets the encoded audio data of the local user.

After calling registerAudioEncodedFrameObserver and setting the encoded audio as AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIC, you can get the encoded audio data of the local user from this callback.

Parameters
bufferThe audio buffer.
samplesPerChannelThe number of samples per channel in the audio frame.
channelsThe number of channels.
  • 1: Mono.
  • 2: Stereo. If the channel uses stereo, the data is interleaved.
samplesPerSecRecording sample rate (Hz).
codecTypeAudio encoding type:
  • AUDIO_CODEC_OPUS (1): OPUS.
  • AUDIO_CODEC_AACLC (8): LC-AAC.
  • AUDIO_CODEC_HEAAC (9): HE-AAC.
  • AUDIO_CODEC_HEAAC2 (11): HE-AAC v2.

◆ onPlaybackAudioEncodedFrame()

abstract void io.agora.rtc2.IAudioEncodedFrameObserver.onPlaybackAudioEncodedFrame ( ByteBuffer  buffer,
int  samplesPerChannel,
int  channels,
int  samplesPerSec,
int  codecType 
)
abstract

Gets the encoded audio data of all remote users.

After calling registerAudioEncodedFrameObserver and setting the encoded audio as AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK, you can get encoded audio data of all remote users through this callback.

Parameters
bufferThe audio buffer.
samplesPerChannelThe number of samples per channel in the audio frame.
channelsThe number of channels.
  • 1: Mono.
  • 2: Stereo. If the channel uses stereo, the data is interleaved.
samplesPerSecRecording sample rate (Hz).
codecTypeAudio encoding type:
  • AUDIO_CODEC_OPUS (1): OPUS.
  • AUDIO_CODEC_AACLC (8): LC-AAC.
  • AUDIO_CODEC_HEAAC (9): HE-AAC.
  • AUDIO_CODEC_HEAAC2 (11): HE-AAC v2.

◆ onMixedAudioEncodedFrame()

abstract void io.agora.rtc2.IAudioEncodedFrameObserver.onMixedAudioEncodedFrame ( ByteBuffer  buffer,
int  samplesPerChannel,
int  channels,
int  samplesPerSec,
int  codecType 
)
abstract

Gets the mixed and encoded audio data of the local and all remote users.

After calling registerAudioEncodedFrameObserver and setting the audio profile as AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED, you can get the mixed and encoded audio data of the local and all remote users through this callback.

Parameters
bufferThe audio buffer.
samplesPerChannelThe number of samples per channel in the audio frame.
channelsThe number of channels.
  • 1: Mono.
  • 2: Stereo. If the channel uses stereo, the data is interleaved.
samplesPerSecRecording sample rate (Hz).
codecTypeAudio encoding type:
  • AUDIO_CODEC_OPUS (1): OPUS.
  • AUDIO_CODEC_AACLC (8): LC-AAC.
  • AUDIO_CODEC_HEAAC (9): HE-AAC.
  • AUDIO_CODEC_HEAAC2 (11): HE-AAC v2.