Table of Contents

 
FadeIn
 

Purpose

Fades a sound in

 

Protoype

void CSoundMngr::FadeIn (string str_music, int i_vol = VOLUME_MAX, int i_step = 5, bool b_remove = false)
 

Parameters

music the ID of the music object to apply effect to
vol the volume level to fade in to
step the modifier used to increase the volume level
remove whether to remove the clip immediately upon completion (TRUE) or until FadeComplete() is called (FALSE)
 

Description

This function fades a music object in from its current volume level to the level specified with i_vol. You can tell it how fast you want to fade the sound in by modifying the i_step value. If you want this effect immediatly removed from the effects queue upon completion, then you can pass in TRUE for b_remove. If, however, you want to be able to call FadeComplete() to check for the effects completion, then you should pass in FALSE instead. Caution: passing in FALSE means the effect will remain in the queue until FadeComplete() is called, so make sure that actually happens.

NOTE: the fade effect is only for music objects because sfx objects should not have the required length for an effective fade

 

Use

CSoundMngr sound;
sound.FadeIn("my_music", 200);
 

Prev: FadeComplete
Next: FadeOut