onProcessPlaybackAudioData method

void onProcessPlaybackAudioData(
  1. Uint8List data,
  2. int dataLength,
  3. ZegoAudioFrameParam param,
  4. double timestamp,
)

Custom audio processing SDK playback PCM audio frame callback.

Available: Since 2.13.0 Description: In this callback, you can receive the SDK playback PCM audio frame. Developers can modify the audio frame data, as well as the audio channels and sample rate. The timestamp can be used for data synchronization, such as lyrics, etc. When to trigger: You need to call enableCustomAudioPlaybackProcessing to enable the function first, and call startPublishingStream, startPlayingStream, startPreview, createMediaPlayer or createAudioEffectPlayer to trigger this callback function. Restrictions: None. Caution: This callback is a high-frequency callback, please do not perform time-consuming operations in this callback.

  • data Audio data in PCM format.
  • dataLength Length of the data.
  • param Parameters of the audio frame.
  • timestamp The audio frame timestamp, starting from 0 when capture is started, the unit is milliseconds (It is effective when there is one and only one stream).

Implementation

void onProcessPlaybackAudioData(
  Uint8List data,
  int dataLength,
  ZegoAudioFrameParam param,
  double timestamp,
) {}