API | Description |
PlayEffect | Plays back sound effect. |
PauseEffect | Pauses sound effect. |
PauseAllEffects | Pauses all sound effects. |
ResumeEffect | Resumes sound effect. |
ResumeAllEffects | Resumes all sound effects. |
StopEffect | Stops sound effect. |
StopAllEffects | Stops all sound effects. |
SetVoiceType | Sets voice changing effect. |
SetKaraokeType | Sets karaoke sound effect. |
GetEffectsVolume | Obtains the volume of sound effects. |
SetEffectsVolume | Sets the volume of sound effects. |
ITMGAudioEffectCtrl virtual int PlayEffect(int soundId, const char* filePath, bool loop, double pitch, double pan, double gain)
Parameter | Type | Description |
soundId | int | Sound effect ID |
filePath | char* | Sound effect path |
loop | bool | Whether to repeat playback |
pitch | double | Payback frequency. The default value is 1.0. Smaller value means slower playback speed and longer duration. |
pan | double | Sound channel, with values ranging from -1.0 to 1.0. The value -1.0 means only the left channel is enabled. |
gain | double | Gain volume, with values ranging from 0.0 to 1.0. The default value is 1.0. |
double pitch = 1.0;double pan = 0.0;double gain = 0.0;//WindowsITMGContextGetInstance()->GetAudioEffectCtrl()->PlayEffect(soundId,filepath,true,pitch,pan,gain);//AndroidITMGContext.GetInstance(this).GetAudioEffectCtrl().PlayEffect(soundId,filePath,loop);//iOS[[[ITMGContext GetInstance] GetAudioEffectCtrl] PlayEffect:soundId filePath:path loop:isLoop];
ITMGAudioEffectCtrl virtual int PauseEffect(int soundId)
Parameter | Type | Description |
soundId | int | Sound effect ID |
ITMGContextGetInstance()->GetAudioEffectCtrl()->PauseEffect(soundId);
ITMGAudioEffectCtrl virtual int PauseAllEffects()
ITMGContextGetInstance()->GetAudioEffectCtrl()->PauseAllEffects();
ITMGAudioEffectCtrl virtual int ResumeEffect(int soundId)
Parameter | Type | Description |
soundId | int | Sound effect ID |
ITMGContextGetInstance()->GetAudioEffectCtrl()->ResumeEffect(soundId);
ITMGAudioEffectCtrl virtual int ResumeAllEffects()
ITMGContextGetInstance()->GetAudioEffectCtrl()->ResumeAllEffects();
ITMGAudioEffectCtrl virtual int StopEffect(int soundId)
Parameter | Type | Description |
soundId | int | Sound effect ID |
ITMGContextGetInstance()->GetAudioEffectCtrl()->StopEffect(soundId);
ITMGAudioEffectCtrl virtual int StopAllEffects()
ITMGContextGetInstance()->GetAudioEffectCtrl()->StopAllEffects();
TMGAudioEffectCtrl 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 | Minion |
ITMGContextGetInstance()->GetAudioEffectCtrl()->setVoiceType(0);
TMGAudioEffectCtrl int SetKaraokeType(int type)
Parameter | Type | Description |
type | int | Indicates the type of local voice changing effect. |
Type parameter | Value | Description |
ITMG_KARAOKE_TYPE_ORIGINAL | 0 | Original |
ITMG_KARAOKE_TYPE_POP | 1 | Pop |
ITMG_KARAOKE_TYPE_ROCK | 2 | Rock |
ITMG_KARAOKE_TYPE_RB | 3 | Hip-hop |
ITMG_KARAOKE_TYPE_DANCE | 4 | Dance |
ITMG_KARAOKE_TYPE_HEAVEN | 5 | Ethereal |
ITMG_KARAOKE_TYPE_TTS | 6 | Voice synthesis |
ITMGContextGetInstance()->GetAudioEffectCtrl()->SetKaraokeType(0);
ITMGAudioEffectCtrl virtual int GetEffectsVolume()
ITMGContextGetInstance()->GetAudioEffectCtrl()->GetEffectsVolume();
ITMGAudioEffectCtrl virtual int SetEffectsVolume(int volume)
Parameter | Type | Description |
volume | int | Volume value |
int volume=1;ITMGContextGetInstance()->GetAudioEffectCtrl()->SetEffectsVolume(volume);
Was this page helpful?