startAudioMixing method Null safety
- NERtcAudioMixingOptions options
Starts audio mixing
This method mixes the specified local or online audio files with the audio stream captured from the recording device.
- Supported audio formats: MP3, M4A, AAC, 3GP, WMA, and WAV. Files that are stored in local storage or URLs are supported.
- If the playback status changes, the onAudioMixingStateChanged callback is triggered on the local client.
Call this method after you join a room. Starting from V4.3.0, if you call this method to play a music file during a call, and manually set the playback volume or publishing volume of the mixing audio stream, the setting is applied when you call the method again during the current call. Starting from V4.4.0, the operation to turn on or off local audio stream capture no longer affects the playback of music files. The music file is still playing after you call enablingLocalAudio(false).
options the options for configuring an audio-mixing task, such as the type of audio-mixing tasks, and full path or URL of a mixing audio file. For more information, see NERtcAudioMixingOptions.
Return 0 indicates a successful call.
Implementation
Future<int> startAudioMixing(NERtcAudioMixingOptions options) async {
IntValue reply = await _api.startAudioMixing(StartAudioMixingRequest()
..path = options.path
..loopCount = options.loopCount
..sendEnabled = options.sendEnabled
..sendVolume = options.sendVolume
..playbackEnabled = options.playbackEnabled
..playbackVolume = options.playbackVolume);
return reply.value ?? -1;
}