preloadAudioMixing abstract method
- @Deprecated('Deprecated since v3.54.1, use RTCAudioEffectPlayer.preload instead')
Preloads the audio file into memory to minimize the loading cost of playing repeatedly.
If you call RTCAudioMixingManager.startAudioMixing first and then call this API with the same ID, the previous mixing task will be stopped, and then the next file will be loaded.
After calling this API to preload A.mp3, if you need to call RTCAudioMixingManager.startAudioMixing to play B.mp3 with the same ID, make sure to call RTCAudioMixingManager.unloadAudioMixing to unload A.mp3 first.
You can use the URL of the online file, and the absolute path of the local file. For the URL of the online file, only https protocol is supported.
Audio file formats supported by different platforms are as follows:
mp3 | mp4 | aac | m4a | 3gp | wav | ogg | |
---|---|---|---|---|---|---|---|
Android | Y | Y | Y | Y | Y | Y | Y |
iOS | Y | Y | Y | Y | Y | Y |
Notes:
- You can only preload the audio file of length less than 20s, otherwise the RTCVideoEventHandler.onAudioMixingStateChanged will be triggered notifying the preloading failure.
- You will also be notified of other states through RTCVideoEventHandler.onAudioMixingStateChanged.
- Unload the preloaded file with RTCAudioMixingManager.unloadAudioMixing.
Implementation
@Deprecated(
'Deprecated since v3.54.1, use RTCAudioEffectPlayer.preload instead')
Future<void> preloadAudioMixing({
required int mixId,
required String filePath,
});