setAudioEffectPreset method
Sets an SDK preset audio effect.
Since v3.2.1
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better audio effect quality, Agora recommends calling RtcEngine.setAudioProfile and setting the scenario
parameter to GameStreaming(3)
before calling this method.
Note
- You can call this method either before or after joining a channel.
- Do not set the profile parameter of RtcEngine.setAudioProfile to
SpeechStandard(1)
; otherwise, this method call fails. - This method works best with the human voice. Agora does not recommend using this method for audio containing music.
- If you call this method and set the preset parameter to enumerators except
RoomAcoustics3DVoice
orPitchCorrection
, do not call RtcEngine.setAudioEffectParameters; otherwise, RtcEngine.setAudioEffectParameters overrides this method. - After calling this method, Agora recommends not calling the following methods, because they can override
setAudioEffectPreset
:
Parameter preset
The options for SDK preset audio effects. See AudioEffectPreset.
Implementation
@override
Future<void> setAudioEffectPreset(AudioEffectPreset preset) {
return _invokeMethod('setAudioEffectPreset',
{'preset': AudioEffectPresetConverter(preset).value()});
}