This document describes how to integrate with and debug GME APIs for voice changing effects.
libgmesoundtouch
library file of the GME SDK. Ensure that the project's library files include libgmesoundtouch
. For more information, see SDK Version Upgrade Guide.After successful room entry and mic enablement, call the SetVoiceType
API to set the voice changing effect. If the API returns 0, the call is successful, and the local sound heard by users in the room has the voice changing effect. To test the effect, use the in-ear monitoring feature (API: EnableLoopBack).
public static class ITMG_VoiceType {
public static final int ITMG_VOICE_TYPE_ORIGINAL_SOUND = 0;
public static final int ITMG_VOICE_TYPE_LOLITA = 1;
public static final int ITMG_VOICE_TYPE_UNCLE = 2;
public static final int ITMG_VOICE_TYPE_INTANGIBLE = 3;
public static final int ITMG_VOICE_TYPE_DEAD_FATBOY = 4;
public static final int ITMG_VOICE_TYPE_HEAVY_MENTAL = 5;
public static final int ITMG_VOICE_TYPE_DIALECT = 6;
public static final int ITMG_VOICE_TYPE_INFLUENZA = 7;
public static final int ITMG_VOICE_TYPE_CAGED_ANIMAL = 8;
public static final int ITMG_VOICE_TYPE_HEAVY_MACHINE = 9;
public static final int ITMG_VOICE_TYPE_STRONG_CURRENT = 10;
public static final int ITMG_VOICE_TYPE_KINDER_GARTEN = 11;
public static final int ITMG_VOICE_TYPE_HUANG = 12;
};
public abstract int SetVoiceType(int type);
Parameter | Type | Description |
---|---|---|
type | int | Indicates the type of local voice changing effect. |
Type parameter | Value | Description |
---|---|---|
ITMG_VOICE_TYPE_ORIGINAL_SOUND | 0 | Original |
ITMG_VOICE_TYPE_LOLITA | 1 | Lolita |
ITMG_VOICE_TYPE_UNCLE | 2 | Uncle |
ITMG_VOICE_TYPE_INTANGIBLE | 3 | Ethereal |
ITMG_VOICE_TYPE_DEAD_FATBOY | 4 | Fatty |
ITMG_VOICE_TYPE_HEAVY_MENTA | 5 | Heavy metal |
ITMG_VOICE_TYPE_DIALECT | 6 | Foreign |
ITMG_VOICE_TYPE_INFLUENZA | 7 | Catching cold |
ITMG_VOICE_TYPE_CAGED_ANIMAL | 8 | Animal |
ITMG_VOICE_TYPE_HEAVY_MACHINE | 9 | Machine |
ITMG_VOICE_TYPE_STRONG_CURRENT | 10 | Strong current |
ITMG_VOICE_TYPE_KINDER_GARTEN | 11 | Kid |
ITMG_VOICE_TYPE_HUANG | 12 | Urchin |
ITMGContextGetInstance()->GetAudioEffectCtrl()->setVoiceType(0);
Voice changing doesn't affect the original voice message, as the voice changing effect will be reflected only during playback.
Add voice changing parameters when calling the voice message playback API.
public abstract int PlayRecordedFile(String filePath,int voicetype);
Parameter | Type | Description |
---|---|---|
filePath | string | Local audio file path |
voicetype | int | Voice changer type |
Error Code Value | Cause | Suggested Solution |
---|---|---|
20485 | Playback is not started. | Ensure the existence of the file and the validity of the file path. |
Was this page helpful?