enableAudioProcessor method
@detail api
@author gongzhengduo
@brief Enable audio frames callback for custom processing and set the format for the specified type of audio frames.
@param method The types of audio frames. See AudioProcessorMethod{@link #AudioProcessorMethod}. Set this parameter to process multiple types of audio.
With different values, you will receive the corresponding callback:
- For locally captured audio, you will receive onProcessRecordAudioFrame{@link #IAudioFrameProcessor#onProcessRecordAudioFrame}.
- For mixed remote audio, you will receive onProcessPlayBackAudioFrame{@link #IAudioFrameProcessor#onProcessPlayBackAudioFrame}.
- For audio from remote users, you will receive onProcessRemoteUserAudioFrame{@link #IAudioFrameProcessor#onProcessRemoteUserAudioFrame}.
- For SDK-level in-ear monitoring audio, you will receive onProcessEarMonitorAudioFrame{@link #IAudioFrameProcessor#onProcessEarMonitorAudioFrame}.
- For shared-screen audio, you will receive onProcessScreenAudioFrame{@link #IAudioFrameProcessor#onProcessScreenAudioFrame}.
@param format The format of audio frames. See AudioFormat{@link #AudioFormat}.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details
@note
- Before calling this API, call registerAudioProcessor{@link #RTCEngine#registerAudioProcessor} to register a processor.
- To disable custom audio processing, call disableAudioProcessor{@link #RTCEngine#disableAudioProcessor}.
Implementation
FutureOr<int> enableAudioProcessor(
AudioProcessorMethod method, AudioFormat format) async {
return await nativeCall('enableAudioProcessor', [method.$value, format]);
}