IAudioFrameObserver

The audio frame observer.

You can call registerAudioFrameObserver to register or unregister the IAudioFrameObserver audio frame observer.

onPlaybackAudioFrameBeforeMixing

Retrieves the audio frame of a specified user before mixing.

public abstract boolean onPlaybackAudioFrameBeforeMixing(int userId, int type,
                int samplesPerChannel, int bytesPerSample, int channels, int samplesPerSec, ByteBuffer buffer,
                long renderTimeMs, int avsync_type);

Parameters

userId
The user ID of the specified user.
type
The audio frame type.
samplesPerChannel
The number of samples per channel in the audio frame.
bytesPerSample
The number of bytes per audio sample. For example, each PCM audio sample usually takes up 16 bits (2 bytes).
channels
The number of channels.
  • 1: Mono.
  • 2: Stereo. If the channel uses stereo, the data is interleaved.
samplesPerSec
Recording sample rate (Hz).
buffer
The audio buffer. The buffer size = samplesPerChannel x channels x bytesPerSample.
renderTimeMs
The timestamp (ms) of the external audio frame. You can use this parameter for the following purpose: Synchronize audio and video frames in video or audio related scenarios, including where external video sources are used.
avsync_type
Reserved for future use.

Returns

Without practical meaning.