onRecordAudioFrame method

FutureOr<void> onRecordAudioFrame(
  1. dynamic audioFrame
)
override

@detail callback @author wangjunzheng @brief 返回麦克风录制的音频数据 @param audioFrame 音频数据, 参看 IAudioFrame{@link #IAudioFrame}。

Implementation

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