Game Development Reference
In-Depth Information
can control the initiation of a sound, its duration and loudness, frequency of repetition or loops, with simple
LSL scripts and sound clips in the contents of an object or prim. More advanced versions of these sound
scripts control interactive qualities and create prolonged cascading sound effects for a seamless atmosphere.
11.3.1 a B iT aBouT B inaural s ound
In the real world, most of us have two working ears that hear the world monaurally, each ear acting like one
speaker or one channel to the audio cortex of our brains. You experience and locate the origin of sounds
by comparing what each of your ears hears and the difference between the signals. This is the essence of
binaural hearing. Not only can you hear sound from all directions simultaneously, but your sense of hearing
also can function in complete darkness to locate the source of the sound—how unlike our eyes, which need
light and function in the narrow cone of our visual ield.
Audio in a virtual space, like Second Life and OpenSim is 3D sound, in other words, a virtual re-creation
of our binaural experience in the real world. This is especially noticeable when you wear headphones and can
clearly hear the location, volume, and Doppler effects. If you use speakers with your computer, the sounds
from each of them will reach both ears, but your binaural recognition is diminished due to sound overlap
and reverberation.
In a virtual world, audio is listened to by the “microphone” on your avatar's camera. The viewer identiies
the coordinates of your avatar in the region relative to the sound emitter. By measuring the distance between
your avatar and the sound emitter as well as the difference in angular measurement between the avatar's
rotation (azimuth) and elevation relative to the sound emitter, the viewer can calculate the volume changes it
needs to make in the two sound channels to give your ears the sense of distance and location for the sounds
being emitted. From the avatar's velocity and direction of travel relative to the sound emitter, the viewer can
calculate a pitch and volume change in the sound, which creates a Doppler effect, as your avatar lies by a
sound emitter [6].
Much like a single lightbulb that is radiating light in a large dark room, the sound is emitted in a sphere
from the center of the source and has a “falloff” range that dims it and cuts it off when you are too far away.
That falloff effect is called attenuation in both audio and lighting. Attenuation is a variable that you can
manipulate by changing the volume settings in a sound-playing script.
11.4 BUILDING BASICS FOR A SOUND ENVIRONMENT
Now that you have a deeper understanding of how sound works in a virtual world, you can start to build your
own soundscapes. What kind of sound iles do you need? If you look at the Second Life game engine, you
see that it supports the kinds of sound and sound sources discussed in this section.
11.4.1 T ypes of s ound s upporTed in V irTual e nVironmenTs
According to the game engine database at Devmaster.net (http://devmaster.net/devdb), these kinds of sounds
and compression formats are supported by the Second Life virtual environment game engine:
3D sound. This kind of sound provides us with (1) the location of sound via two-channel binaural
sound; (2) volume attenuation, or the fading of sound volume as the distance between the listener
and the emitter increases; (3) Doppler effect, or the apparent change in pitch as a noise emitter
passes the listener at high speed.
Search WWH ::




Custom Search