Game Development Reference
In-Depth Information
Common audio features
As we create more and more complex scenes, we want more from our sounds and music.
For example, some sounds might be louder than others, and we would like to lower their
volume when we play them in the game. We can do that with
SoundSource::setVolume() . The supported volume values are from 0 (mute) to
100 (full volume), and every sound source starts with a default value of 100. We can get the
current volume with SoundSource::getVolume() .
Another characteristic of sound is pitch. The pitch is the perceived frequency of a sound.
For example, a C4 note has a lower pitch than a note of E4 . We can change the pitch factor
of the original audio source by calling SoundSource::setPitch() . This is an artifi-
cial method to increase the pitch, which results in speeding/slowing the speed of the play-
back. The default value of the factor is 1 , which doesn't alter the pitch of the original
sound. We can get the current pitch by calling SoundSource::getPitch() .
Search WWH ::




Custom Search