Game Development Reference
In-Depth Information
Streaming sound. This is sound brought in from a website URL through media on a prim.
FMOD. This advanced tool is free to use for noncommercial purposes (http://fmod.org/).
Ogg-Vorbis compressed format streamed. This is a common compression format.
QuickTime MOV video streamed. This is another common compression format.
Doppler effect. Doppler pitch shifting is the pitch-shifting effect heard by a listener as an emitter
moves by quickly.
11.4.2 r eQuiremenTs for s ound f iles W hen i mporTing T hem To V irTual e nVironmenTs
To import sounds into Second Life and OpenSim virtual environments, the absolute requirements for sound
clips are as follows:
1. Sound clips saved as .wav format with the standard PCM (pulse-code modulation).
2. 16-bit/44.1-kHz/mono or stereo (converted to mono).
3. Length of less than 10 seconds. Your clip length can be 9.99 seconds but no longer; an 10.1-second
audio ile will fail to upload.
Note: Sound clips for Unity can be longer than 10 seconds in duration. For a “Build It Once” approach, try
building your Unity sound from smaller units less than 10 seconds. Then, you can utilize audio that imports
into virtual spaces like Second Life and OpenSim while maintaining a library for the longer audio themes
in your Unity builds.
11.5 HOW TO CONTROL SOUND IN A VIRTUAL WORLD
Sound-making objects are created and controlled with the addition of LSL (Linden scripting language)
scripts into the objects' content section via the object editor. The sound in Unity is controlled via C# or Unity
Script (like Java script) or via Boo (a .net language like Python). Assuming you have the sound clip ready to
go, you initiate and control the sound emission with various kinds of scripts that respond to things like avatar
presence (a burglar alarm); avatar touch (a doorbell); the time of day (larks in the day, owls at night); wind
direction (noise from a windmill); or location (parcel limited sound for the dance loor in your nightclub).
The possibilities are practically limitless, just as our real-world sound-making devices are. A  source of
scripts and sample sounds accessed by their UUIDs (Universally Unique IDentiiers) to test these various
types of sound activators for the Second Life viewers is available online (http://wiki.secondlife.com/wiki/
Audio_Test). Within this old but still valuable wiki are many sources of information for the content creator.
Here, you will ind scripts for playing sound, looping sound, and synching various loops together for a
bigger effect.
If you have a server available, sound clips can be played continuously and streamed on your region.
This technique has been used successfully to create an overall ambiance for themed and gaming regions
in Second Life. Care should be exercised with this approach, however, as having sound effects that appear
to come from everywhere can seem disjointed and inappropriate to the visitor if there is no visual event or
object to support the reason for the sound. This is best used for Zone and Effect sounds like wind, weather,
and Non-Digetic sounds such as theme music.
Another factor to be aware of is lag and how it affects sound. One way to avoid awkward pauses in audio is
to utilize a sound “preloader” function in your scripting. This will load the sounds when the object is rezzed
in your environment so that they are ready to be activated on a touch event.
Search WWH ::




Custom Search