enableAudioFrameCallback method
- ByteRTCAudioFrameCallbackMethod method,
- ByteRTCAudioFormat 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 ByteRTCAudioFrameCallbackMethod{@link #ByteRTCAudioFrameCallbackMethod}.
If method is set as 0, 1, 2, or 5, set format to the accurate value listed in the audio parameters format.
If method is set as 3, set format to auto.
@param format Audio parameters format. See ByteRTCAudioFormat{@link #ByteRTCAudioFormat}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note After calling this API and registerAudioFrameObserver:{@link #ByteRTCMediaPlayer#registerAudioFrameObserver}, ByteRTCAudioFrameObserver{@link #ByteRTCAudioFrameObserver} 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(
ByteRTCAudioFrameCallbackMethod method, ByteRTCAudioFormat format) async {
return await nativeCall(
'enableAudioFrameCallback:format:', [method.$value, format]);
}