C4 Engine
C4 Engine API Documentation

Sound::VaryFrequency

Defined in:  C4Sound.h
Varies the frequency of a sound over a specific time period.
Prototype

void VaryFrequency(float frequency, int32 time, bool stop = false);

Parameters
frequency The new frequency to which the sound should be gradually changed.
time The time interval, in milliseconds, over which the variation should occur.
stop Indicates whether the sound should be stopped at the end of the variation.
Description
The VaryFrequency function varies the frequency of a sound to that given by the frequency parameter over the time interval given by the time parameter.

If the stop parameter is true, then the sound is stopped at the end of the variation period, and the frequency variation completion callback function is called, if any. If the sound is nonpersistent, then it is released at this point.

If the time parameter is less than or equal to zero, then the sound's frequency is set to frequency immediately. If the stop parameter is true in this case, then the sound is stopped before the VaryFrequency function returns.

It can be determined whether a sound's frequency is currently being varied by calling the Sound::FrequencyVarying function.
See Also

Sound::FrequencyVarying

Sound::SetFrequencyVariationCompletionCallback

Sound::VaryVolume