playAllEffects abstract method

Future<void> playAllEffects({
  1. required int loopCount,
  2. required double pitch,
  3. required double pan,
  4. required int gain,
  5. bool publish = false,
})

Plays all audio effect files.

After calling preloadEffect multiple times to preload multiple audio effect files, you can call this method to play all preloaded audio effect files.

  • loopCount Number of times the audio effect file is looped: -1: Loops indefinitely until stopEffect or stopAllEffects is called. 0: Plays once. 1: Plays twice.
  • pitch Pitch of the audio effect. Value range is 0.5,2.0. Default is 1.0, which represents the original pitch. The smaller the value, the lower the pitch.
  • pan Spatial position of the audio effect. Value range is -1.0,1.0: -1.0: Audio effect appears on the left. 0: Audio effect appears in the center. 1.0: Audio effect appears on the right.
  • gain Volume of the audio effect. Value range is 0,100. 100 is the default and represents the original volume. The smaller the value, the lower the volume.
  • publish Whether to publish the audio effect to remote users: true : Publishes the audio effect to remote users. Both local and remote users can hear it. false : (Default) Does not publish the audio effect to remote users. Only local users can hear it.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> playAllEffects(
    {required int loopCount,
    required double pitch,
    required double pan,
    required int gain,
    bool publish = false});