enableAudioMixing method
- bool enable
Enables or disables audio mixing function.
Available since: 1.9.0, will be deprecated soon. It is recommended to use the media player createMediaPlayer or the audio effect player createAudioEffectPlayer to implement the audio mixing function.
Description: After the audio mixing function is turned on, the SDK will mix the audio data prepared by the developer with the audio data collected by the SDK before publishing.
Use case: Developers can use this function when they need to mix their own songs, sound effects or other audio data into the publishing stream.
Default value: When this function is not called, this is disabled by default.
When to call: It needs to be called after createEngine.
Related APIs: After enabling audio mixing, the developer needs to provide the SDK with the audio data that needs to be mixed in the onAudioMixingCopyData callback.
Caution: After you start audio mixing, the SDK will play the mixed audio on the local (publisher side) by default. If you do not want to play it locally but only on the remote (player side), please call muteLocalAudioMixing to set the local audio mixing mute. Recommend to use audio effect player or media player for audio mixing.
Restrictions: None.
enableWhether to enable audio mixting, true: enable, false: disable
Implementation
Future<void> enableAudioMixing(bool enable) async {
return await ZegoExpressImpl.instance.enableAudioMixing(enable);
}