start abstract method

Future<int?> start(
  1. int effectId, {
  2. required String filePath,
  3. AudioEffectPlayerConfig config = const AudioEffectPlayerConfig(),
})

Starts to play the audio effect file.
This API can be called multiple times with different IDs and file paths for multiple effects at the same time.

effectId: Audio effect ID. Used for identifying the audio effect, please ensure that the audio effect ID is unique.
If this API is called repeatedly with the same ID, the previous effect will stop and the next effect will start, and you'll receive RTCAudioEffectPlayerEventHandler.onAudioEffectPlayerStateChanged.

filePath: Audio effect file paths.
URL of online file, URI of local file, full path to local file, or path to local file starting with /assets/ are supported. For URL of online file, only the https protocol is supported.
Recommended sample rate for audio effect files: 8KHz、16KHz、22.05KHz、44.1KHz、48KHz.
Local audio effect file formats supported by different platforms:

mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYYYY
iOS/macOSYYYYYY
WindowsYYYYYYYY
Online audio effect file formats supported by different platforms:
mp3mp4aacm4a3gpwavoggtswma
AndroidYYYYY
iOS/macOSYYYY
WindowsYYYYYYY

config: See AudioEffectPlayerConfig{@link #AudioEffectPlayerConfig}.

Return value:

  • 0: Success.
  • <0: Failure.

Notes:

Implementation

Future<int?> start(
  int effectId, {
  required String filePath,
  AudioEffectPlayerConfig config = const AudioEffectPlayerConfig(),
});