logo
Video Call
On this page

Voice Changer/Reverb/Stereo

2026-03-12

Introduction

In live streaming, voice chat room, and Karaoke room scenarios, to increase fun and interactivity, players can use voice changers to be funny, use reverb to enhance the atmosphere, and use stereo to make the sound more three-dimensional. ZEGO Express SDK provides a variety of preset voice changer, reverb, reverb echo, and stereo effects. Developers can flexibly set the sound they want. If they need to preview, they can enable ear monitor for testing.

  • Voice Changer: By changing the user's pitch, the output sound is perceptually different from the original sound, achieving various effects such as male to female.
  • Reverb: Through special processing of sound, create reverb effects of different environments, making the sound sound as if it were emitted in scenes such as concert halls and large churches.
  • Reverb Echo: Through special processing of sound, can be combined with voice changer and reverb to achieve various custom sound effects, such as ethereal, robot voice.
  • Virtual Stereo: Through deep use of dual-channel technology, virtually generate various position angles of the sound source, achieving stereo, 3D surround sound, sound positioning and other effects.

You can experience the SDK's preset human voice effects through the Audio Effects Experience DEMO.

Note

This feature is only effective for sounds captured by the SDK. Developers can dynamically adjust voice changer, reverb, reverb echo, and virtual stereo during calls or live streaming.

Download Sample Source Code

Please refer to Download Sample Source Code to obtain the source code.

For related source code, please check the files in the "/ZegoExpressExample/Examples/AdvancedAudioProcessing/VoiceReverbStereo" directory.

Prerequisites

Before using voice changer/reverb/stereo, ensure that:

Usage Steps

Voice Changer

There are two ways to set voice changer: preset voice changer and custom voice changer.

Set Preset Voice Changer

Note

If you need to set custom voice changer, please see Set Custom Voice Changer.

Call the setVoiceChangerPreset method to use the SDK's preset voice changer effects.

The preset voice changer effects of ZegoVoiceChangerPreset are as follows. Developers can choose as needed:

Type NamePreset ValueDescriptionVoice Changer Type
NONE0No voice changer-
MEN_TO_CHILD1Male to childVoice changer
MEN_TO_WOMEN2Male to femaleVoice changer
WOMEN_TO_CHILD3Female to childVoice changer
WOMEN_TO_MEN4Female to maleVoice changer
FOREIGNER5Foreigner sound effectVoice changer
OPTIMUS_PRIME6Optimus Prime sound effectVoice changer
ANDROID7Robot sound effectVoice changer
ETHEREAL8Ethereal sound effectTimbre transformation
MALE_MAGNETIC9Magnetic maleRoom beautification
FEMALE_FRESH10Fresh femaleRoom beautification
MAJOR_C11C Major electric toneElectric tone effect
MINOR_A12A Minor electric toneElectric tone effect
HARMONIC_MINOR13Harmonic Minor electric toneElectric tone effect
FEMALE_ENERGETIC14Energetic female sound effectRoom beautification
RICH_NESS15Rich sound effectRoom beautification
MUFFLED16Muffled sound effectRoom beautification
ROUNDNESS17Round sound effectRoom beautification
FALSETTO18Falsetto sound effectRoom beautification
FULLNESS19Full sound effectRoom beautification
CLEAR20Clear sound effectRoom beautification
HIGHLY_RESONANT21High-pitched sound effectRoom beautification
LOUD_CLEAR22Loud and clear sound effectRoom beautification
MINIONS23Minion sound effectVoice changer
AUTOBOT30Autobot sound effectVoice changer
OUT_OF_POWER31Out of power sound effectVoice changer
Note

To use the Autobot and OutOfPower voice changer effects, please contact technical support for custom SDK packaging.

The following example code takes male to child as an example:

ZegoExpressSDK::getEngine()->setVoiceChangerPreset(ZEGO_VOICE_CHANGER_PRESET_MEN_TO_CHILD);

Set Custom Voice Changer

Note

If you need to set preset voice changer, please see Set Preset Voice Changer.

If the SDK's preset voice changer effects cannot meet the requirements, developers can call the setVoiceChangerParam method in ZegoVoiceChangerParam and set custom voice changer through the pitch parameter pitch. The value range of this parameter is [-12.0, 12.0]. The larger the value, the sharper the sound. The default value is "0.0" (that is, no voice changer).

Warning

Version 2.18.0 and earlier, the value range is [-8.0, 8.0].

ZegoVoiceChangerParam param;
param.pitch = 2.0f;
ZegoExpressSDK::getEngine()->setVoiceChangerParam(param);

Reverb

There are two ways to set reverb: preset reverb and custom reverb.

Set Preset Reverb

Note

If you need to set custom reverb, please see Set Custom Reverb.

Call setReverbPreset to set reverb through preset enumeration.

The preset reverb effects of ZegoReverbPreset are as follows. Developers can choose as needed:

Type NamePreset ValueDescriptionReverb Type
NONE0None-
SOFT_ROOM1Small roomSpatial shaping
LARGE_ROOM2Large roomSpatial shaping
CONCERT_HALL3Concert hallSpatial shaping
VALLEY4ValleySpatial shaping
RECORDING_STUDIO5Recording studioSpatial shaping
BASEMENT6BasementSpatial shaping
KTV7KTV, suitable for users with obvious timbre flawsSpatial shaping
POPULAR8PopMusical style
ROCK9RockMusical style
VOCAL_CONCERT10Vocal concertSpatial shaping
GRAMO_PHONE11GramophoneSpatial shaping
ENHANCED_KTV12Enhanced KTV, more focused and brighter KTV vocal effects, suitable for ordinary users and professional usersSpatial shaping

The following example code takes large room mode as an example:

ZegoExpressSDK::getEngine()->setReverbPreset(ZEGO_REVERB_PRESET_LARGE_ROOM);

Set Custom Reverb

Note

If you need to set preset reverb, please see Set Preset Reverb.

If the SDK's preset reverb types cannot meet the requirements, developers can call the setReverbAdvancedParam method in ZegoReverbAdvancedParam and achieve the reverb effects needed by developers through relevant parameter combinations (for detailed parameter descriptions, please refer to the API documentation).

ZegoReverbAdvancedParam reverbParam;
// Reverb damping
reverbParam.damping = 50.0;
// Reverberance
reverbParam.reverberance = 50.0;
// Room size
reverbParam.roomSize = 50.0;
// Wet signal only
reverbParam.wetOnly = false;
// Wet signal gain (dB), value range [-20.0, 10.0]
reverbParam.wetGain = 5.0;
// Dry signal gain (dB), value range [-20.0, 10.0]
reverbParam.dryGain = 5.0;
// Low frequency attenuation, default is no attenuation (100%)
reverbParam.toneLow = 80.0;
// High frequency attenuation, default is no attenuation (100%)
reverbParam.toneHigh = 80.0;
// Initial delay time (ms). Value range [0, 200]
reverbParam.preDelay = 20.0;
// Stereo width (percentage), default value is 0%
reverbParam.stereoWidth = 0.0;
ZegoExpressSDK::getEngine()->setReverbAdvancedParam(reverbParam);
Warning

When custom reverb parameters are set, the preset reverb effect set when enabling reverb will become invalid. If you want to use SDK preset parameters again, you can use the setReverbPreset preset enumeration method to set.

Reverb Echo

Call the setReverbEchoParam method and achieve the reverb echo effects needed by developers through relevant parameter combinations (for detailed parameter descriptions, please refer to the API documentation).

The following example code takes implementing ethereal effect as an example:

ZegoReverbEchoParam echoParamEthereal;
// Gain of input audio signal, value range [0.0, 1.0]
echoParamEthereal.inGain = 0.8;
// Gain of output audio signal, value range [0.0, 1.0]
echoParamEthereal.outGain = 1.0;
// Number of echoes, value range [0, 7]
echoParamEthereal.numDelays = 7;
// Delays of echo signals respectively, in milliseconds, value range [0, 5000] ms
echoParamEthereal.delay = {230, 460, 690, 920, 1150, 1380, 1610};
// Decay coefficients of echo signals respectively, value range [0.0, 1.0]
echoParamEthereal.decay = {0.41f, 0.18f, 0.08f, 0.03f, 0.009f, 0.003f, 0.001f};
ZegoExpressSDK::getEngine()->setReverbEchoParam(echoParamEthereal);

Virtual Stereo

Set Publishing Stream Audio Channel Count

If you need to enable the virtual stereo function, you must first call the setAudioConfig method before publishing stream to set the audio encoding channel to Stereo dual channel (the default is Mono single channel).

The following example constructs ZegoAudioConfig through preset enumeration to set to dual channel:

ZegoAudioConfig audioConfig = ZegoAudioConfig(ZEGO_AUDIO_CONFIG_PRESET_STANDARD_QUALITY_STEREO);
ZegoExpressSDK::getEngine()->setAudioConfig(audioConfig);

Set Virtual Stereo Parameters

After setting the audio encoding channel to dual channel, call the enableVirtualStereo method, enable virtual stereo through the enable parameter, and set the sound source angle of virtual stereo through the angle parameter before there is a stereo effect. The angle range is 0~360, and can generally be set to 90 degrees (that is, directly ahead).

Note

Starting from version 2.15.0, the SDK newly supports all-around virtual stereo effects. The usage is to set the "angle" angle parameter to "-1".

The following example is for enabling virtual stereo and setting the angle to 90 degrees:

ZegoExpressSDK::getEngine()->enableVirtualStereo(true, 90);

The following example is for enabling all-around virtual stereo:

ZegoExpressSDK::getEngine()->enableVirtualStereo(true, -1);
2024-05-24

Previous

Audio 3A Processing

Next

Scenario-based AI Noise Reduction

On this page

Back to top