preloadEffectEx abstract method

Future<void> preloadEffectEx({
  1. required RtcConnection connection,
  2. required int soundId,
  3. required String filePath,
  4. int startPos = 0,
})

Preloads the specified audio effect into the channel.

Since Available since v6.6.2. Each time you call this method, only one audio effect file can be preloaded into memory. To preload multiple audio effect files, call this method multiple times. After preloading, you can call playEffect to play the preloaded audio effect, or call playAllEffects to play all preloaded audio effects. To ensure smooth usage, the size of the audio effect file should not exceed the limit. Agora recommends calling this method before joining the channel. If you call preloadEffectEx before playEffectEx, the file resource is not released after playEffectEx is executed. The next time you call playEffectEx, it will start playing from the beginning. If you do not call preloadEffectEx before playEffectEx, the resource is destroyed after playEffectEx is executed. The next time you call playEffectEx, it will attempt to reopen the file and play from the beginning.

  • connection Connection information. See RtcConnection.
  • soundId Audio effect ID.
  • filePath The absolute path of a local file or the URL of an online file. Supported audio formats include: mp3, mp4, m4a, aac, 3gp, mkv, and wav.
  • startPos The start position for playing the audio effect file, in milliseconds.

Returns 0: Success. < 0: Failure.

Implementation

Future<void> preloadEffectEx(
    {required RtcConnection connection,
    required int soundId,
    required String filePath,
    int startPos = 0});