setLocalVoiceFormant

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

virtual int setLocalVoiceFormant(double formantRatio) = 0;

Details

Since
v4.2.0

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.

Parameters

formantRatio
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.

Returns

  • 0: Success.
  • < 0: Failure.