enableAudioFrameCallback method

FutureOr<int> enableAudioFrameCallback(
  1. AudioFrameCallbackMethod method,
  2. AudioFormat format
)

@detail api @author gongzhengduo @brief Enable audio frames callback and set the format for the specified type of audio frames. @param method Audio data callback method. See AudioFrameCallbackMethod{@link #AudioFrameCallbackMethod}.
If method is set as AUDIO_FRAME_CALLBACK_RECORD(0), AUDIO_FRAME_CALLBACK_PLAYBACK(1), AUDIO_FRAME_CALLBACK_MIXED(2), or AUDIO_FRAME_CALLBACK_CAPTURE_MIXED(5), set format to the accurate value listed in the audio parameters format.
If method is set as AUDIO_FRAME_CALLBACK_REMOTE_USER(3), set format to auto. @param format Audio parameters format. See AudioFormat{@link #AudioFormat}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note After calling this API and registerAudioFrameObserver{@link #RTCEngine#registerAudioFrameObserver}, IAudioFrameObserver{@link #IAudioFrameObserver} will receive the corresponding audio data callback. However, these two APIs are independent of each other and the calling order is not restricted.

Implementation

FutureOr<int> enableAudioFrameCallback(
    AudioFrameCallbackMethod method, AudioFormat format) async {
  return await nativeCall(
      'enableAudioFrameCallback', [method.$value, format]);
}