Set the Voice Effect
Update time: 2025/06/11 16:45:39
For multiple strong interaction scenarios in the pan-entertainment industry, a wide variety of beautification and special effects, such as voice beautifier or changer, is needed for a more fun and better interactive experience. In the co-hosting voice chat or audio live streaming scenarios, a voice beautifier or changer can beautify the voice of the host or co-host to enhance the recreational atmosphere of the scenario.
The NERTC SDK offers a wide selection of voice beautifier/changer effects. In addition, you may also set local voice equalization or mixing for customized voice effect to enhance the atmosphere of the scenario.
Considerations
The setAudioEffectPreset and setLocalVoicePitch methods are mutually exclusive. After either method is called, the other method will be reset to the default value.
Method
Preset voice effects
The NERTC SDK offers a wide selection of preset voice effects to meet your voice beautifier/changer needs under different scenarios.
Voice beautifier effects
Voice beautifier is defined as adjustments to the voice pitch. For example, to make the voice lower, mellower or clearer. In addition, NERTC ’s preset voice beautifier effects may also be used for building scenic spatial environmental effects. Scenic spatial atmosphere makes the human voice sound as authethic as in a specific space. Call setVoiceBeautifierPreset to use the SDK preset voice beautifier effects. The following voice beautifier effects are available for now:
| Enumeration | Description |
|---|---|
| VOICE_BEAUTIFIER_OFF | (Default) Voice beautifier is disabled. |
| VOICE_BEAUTIFIER_MUFFLED | Low voice. |
| VOICE_BEAUTIFIER_MELLOW | Mellow voice. |
| VOICE_BEAUTIFIER_CLEAR | Clear voice. |
| VOICE_BEAUTIFIER_MAGNETIC | Magnetic voice. |
| VOICE_BEAUTIFIER_RECORDINGSTUDIO | Recording studio. |
| VOICE_BEAUTIFIER_NATURE | Sounds of nature. |
| VOICE_BEAUTIFIER_KTV | KTV. |
| VOICE_BEAUTIFIER_REMOTE | Remote. |
| VOICE_BEAUTIFIER_CHURCH | Church. |
| VOICE_BEAUTIFIER_BEDROOM | Bedroom. |
| VOICE_BEAUTIFIER_LIVE | Live. |
Voice changer effects
Voice changer is defined as mutations of the voice features, for example, to make the voice sound like a robot or a loli. Call setAudioEffectPreset to use the SDK preset voice changer effects. The following voice changer effects are available for now:
| Enumeration | Description |
|---|---|
| AUDIO_EFFECT_OFF | (Default) Voice changer is disabled. |
| VOICE_CHANGER_EFFECT_ROBOT | Robot voice. |
| VOICE_CHANGER_EFFECT_GIANT | Giant voice. |
| VOICE_CHANGER_EFFECT_HORROR | Horrific voice. |
| VOICE_CHANGER_EFFECT_MATURE | Mature voice. |
| VOICE_CHANGER_EFFECT_MANTOWOMAN | Man-to-woman. |
| VOICE_CHANGER_EFFECT_WOMANTOMAN | Woman-to-man. |
| VOICE_CHANGER_EFFECT_MANTOLOLI | Man-to-loli. |
| VOICE_CHANGER_EFFECT_WOMANTOLOLI | Woman-to-loli. |
Custom voice effects
If the above voice beautifier and changer effects do not meet your needs, you can also create customized voice effects by setting pitch or sound effect equalization.
- Call setLocalVoicePitch to set local voice pitch. For example, turn the pitch up or down.
- Call setLocalVoiceEqualizations to set local voice sound effect equalization or customize the center frequency of the local voice equalization waveband.
Sample code
//preset voice beautifier effects
int preset = NERtcVoiceBeautifierType.VOICE_BEAUTIFIER_MUFFLED;
NERtcEx.getInstance().setVoiceBeautifierPreset(preset);
//preset voice changer effects
int preset = NERtcVoiceChangerType.VOICE_CHANGER_EFFECT_ROBOT;
NERtcEx.getInstance().setAudioEffectPreset(preset);
//Adjust the pitch of voice
double pitch = 0.6; //pitch The pitch input range is 0.5 to 2. The default value is 1
int ret = NERtcEx.getInstance().setLocalVoicePitch(pitch);
//Set local voice sound effect equalization
int gain = 10 // The value range is -15 to 15. The default value is 0
int bandFrequency = NERtcVoiceEqualizationBand.VoiceEqualizationBand_1K;
NERtcEx.getInstance().setLocalVoiceEqualization(bandFrequency, gain);





