Set the formant ratio to change the timbre of human voice.

public abstract int setLocalVoiceFormant(double formantRatio);



Formant ratio affects the timbre of voice. The smaller the value, the deeper the sound will be, and the larger, the sharper.

You can call this method to set the formant ratio of local audio to change the timbre of human voice. After you set the formant ratio, all users in the channel can hear the changed voice. If you want to change the timbre and pitch of voice at the same time, Agora recommends using this method together with setLocalVoicePitch.
Attention: You can call this method either before or after joining a channel.


The formant ratio. The value range is [-1.0, 1.0]. The default value is 0.0, which means do not change the timbre of the voice.
Note: Agora recommends setting this value within the range of [-0.4, 0.6]. Otherwise, the voice may be seriously distorted.


  • 0: Success.
  • < 0: Failure.