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 effects into the memory, you can call this method to play all the specified audio effects for all users in the channel.

  • loopCount The number of times the audio effect loops: -1: Play the audio effect files in an indefinite loop until you call stopEffect or stopAllEffects. 0: Play the audio effect once. 1: Play the audio effect twice.
  • pitch The pitch of the audio effect. The value ranges between 0.5 and 2.0. The default value is 1.0 (original pitch). The lower the value, the lower the pitch.
  • pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0: -1.0: The audio effect shows on the left. 0: The audio effect shows ahead. 1.0: The audio effect shows on the right.
  • gain The volume of the audio effect. The value range is 0, 100. The default value is 100 (original volume). The smaller the value, the lower the volume.
  • publish Whether to publish the audio effect to the remote users: true : Publish the audio effect to the remote users. Both the local user and remote users can hear the audio effect. false : (Default) Do not publish the audio effect to the remote users. Only the local user can hear the audio effect.

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.

Implementation

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