Ability to modify output parameters in real-time (pitch, volume, ...)
3D spatial features (position, attenuation, ...)
$(PARA
Sound is perfect for playing short sounds that can fit in memory and require
no latency, like foot steps or gun shots. For longer sounds, like background
musics or long speeches, rather see Music (which is based on streaming).
In order to work, a sound must be given a buffer of audio data to play. Audio
data (samples) is stored in SoundBuffer, and attached to a sound with the
setBuffer() function. The buffer object attached to a sound must remain alive
as long as the sound uses it. Note that multiple sounds can use the same
sound buffer at the same time.
*)
Sound is the class used to play sounds.
It provides:
$(PARA Sound is perfect for playing short sounds that can fit in memory and require no latency, like foot steps or gun shots. For longer sounds, like background musics or long speeches, rather see Music (which is based on streaming). In order to work, a sound must be given a buffer of audio data to play. Audio data (samples) is stored in SoundBuffer, and attached to a sound with the setBuffer() function. The buffer object attached to a sound must remain alive as long as the sound uses it. Note that multiple sounds can use the same sound buffer at the same time. *)