C4 Engine Terathon Software C4 Engine API Documentation

• Sound Manager

API Links
Developer Links

Sound::Fade

Defined in:  C4Sound.h
Fades a sound to a specific volume.
Prototype

void Fade(float targetVolume, long fadeTime, bool endStop = false);

Parameters
targetVolume The volume to which the sound should be faded.
fadeTime The time interval, in milliseconds, over which the fade should occur.
endStop Indicates whether the sound should be stopped at the end of the fade.
Description
The Fade function fades the sound to the volume given by the targetVolume parameter over the time interval given by the fadeTime parameter. At the end of the fade period, the sound's fade procedure is invoked if one has been installed using the Sound::SetFadeProc function.

If the endStop parameter is true, then the sound is stopped at the end of the fade period. If the sound is nonpersistent, then it is released at this point.

It can be determined whether a sound is currently fading by calling the Sound::Fading function.
See Also

Sound::Fading

Sound::SetFadeProc