onPlayerAudioData property

(void Function(Uint8List data, int dataLength, ZegoAudioFrameParam param, String streamID)?) onPlayerAudioData
getter/setter pair

The callback for obtaining the audio data of each stream.

Available: Since 1.1.0 Description: This function will call back the data corresponding to each playing stream. Different from onPlaybackAudioData, the latter is the mixed data of all playing streams. If developers need to process a piece of data separately, they can use this callback. When to trigger: On the premise of calling setAudioDataHandler to set up listening for this callback, calling startAudioDataObserver to set the mask 0x08 that is 1 << 3, and this callback will be triggered when the SDK audio and video engine starts to play the stream. 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.
  • streamID Corresponding stream ID.

Implementation

static void Function(Uint8List data, int dataLength,
    ZegoAudioFrameParam param, String streamID)? onPlayerAudioData;