onRemoteUserAudioFrame method

FutureOr<void> onRemoteUserAudioFrame(
  1. dynamic streamId,
  2. dynamic streamInfo,
  3. dynamic audioFrame
)
override

@detail callback @author wangjunzheng @brief Returns the audio data of one remote user. @param streamId Remote stream ID. @param streamInfo Remote stream information. See StreamInfo{@link #StreamInfo}. @param audioFrame Audio data. See IAudioFrame{@link #IAudioFrame}. @note This callback works on the playback thread. Don't do anything time-consuming in this callback, or it may affect the entire audio playback chain.

Implementation

FutureOr<void> onRemoteUserAudioFrame(
    dynamic streamId, dynamic streamInfo, dynamic audioFrame) async {
  if ($instance == null || $instance is! IAudioFrameObserver) {
    return;
  }
  return ($instance as IAudioFrameObserver).onRemoteUserAudioFrame?.call(
      streamId.toString(),
      packObject(
          audioFrame,
          () => AudioFrame.fromMap(AudioFrame.deepPackedMapValues(
              AudioFrame.mapMemberToConstructorParams(audioFrame)))));
}