FLATLAND TUTORIAL
|
10
| INVISIBLE AUDIBLES: ADDING SOUND
There are four different
ways that sounds can be used in spots: Ambient sounds, the SOUND Block,
sounds attached to blocks in the <CREATE> tag, and sounds assigned to
particular locations in the map. We've already discussed the <AMBIENT_SOUND>
tag that goes in the Head of your spot file. Your visitors will hear the
ambient sound at the same volume throughout the entire spot. The other two
methods of using sound are attached to blocks or locations, and therefore
the sound will get louder as your visitors aproach the block or location
that holds the sound. Currently, all sounds used in spots must be in .wav
format. Most sound processing software will save files in .wav format.
New Blocks If you want to have a sound that appears to come from an object, then
you want to use the <CREATE> tag to add a sound to whatever block you
want. If you just want a sound to emanate from a general area in a SPOT,
then you want to use a SOUND Block or assign it to a particular location
in your map. Even when you are using the SOUND Block, you still need to
use the <CREATE> tag to assign the correct sound to your block, so
lets look at how that works.
Using Sound in the <CREATE> tag <CREATE SYMBOL="x" BLOCK="SOUND"> Be sure to include the path when you name the FILE, if your sounds aren't
in the same folder as your .3dml file.
VOLUME is expressed as a whole number percentage.
PLAYBACK determines how a sound will be played. There are 4 different
PLAYBACK options: PLAYBACK="looped" will cause the sound to play continuously.
If PLAYBACK="once" the sound will of course play only once. If PLAYBACK="single",
then the sound will play once every time the player enters the specified
RADIUS. If PLAYBACK=random", the sound will play at random intervals.
If PLAYBACK="random", you can also specify a range of DELAY times between
playbacks. DELAY times are measured in seconds, and are measured from
the time that the sound begins, rather than when it ends. For example,
if your sound is 5 seconds long, PLAYBACK="random", and DELAY="5..10",
then sometimes the sound will play back to back, (as the length of the
sound file is the same as the minimum delay time), and no more than 5
seconds will ever elapse between when the sound ends and when it begins
again. (The maximum DELAY time, 10 seconds, minus the length of the sound
itself, 5 seconds, leaves a maximum silence of 5 seconds.)
The volume of a sound will drop off gradually as you get farther away
from the source. But if FLOOD="yes", then the sound will play at the specified
volume throughout the specified RADIUS, rather than dropping off gradually.
RADIUS is measured in blocks, and has two different roles. On a sound
with FLOOD="yes", the RADIUS defines how large an area will be filled
with that sound. If VOLUME="100%", FLOOD="yes", and RADIUS="5", then the
sound will be heard at full volume right up to the edge of the 5 block
border, at which point it will turn off completely. On a sound with PLAYBACK="once"
or PLAYBACK="single", the RADIUS acts as a trigger. The sound will be
played when the user enters the specified RADIUS.
ROLLOFF determines how quickly the sound volume will taper off as you
move away from the sound source. In most cases, the default value (ROLLOFF="1.0")
is the most natural setting for this parameter. But if you need more control
over how the sound drops off, you can change the ROLLOFF value. If ROLLOFF="2.0",
then the sound will drop off twice as fast (meaning it will be audible
only half as far away from the source.) If ROLLOFF="0.5", then the sound
will drop off half as fast (meaning it will be audible twice as far away.)
The default values for these attributes are as follows: VOLUME="100%"
PLAYBACK="looped" DELAY="5..10" RADIUS="1" ROLLOFF="1.0"
Note that a block can only have one sound attached to it.
Using Sounds in the <BODY> Improving Performance Just like custom textures, sound files will be downloaded in the order
in which they appear in the 3DML file. Because sound files are often quite
large, it is a good idea to list any <CREATE> tags that include sounds
last. On the other hand, if you want your visitors to hear a sound immediately
upon entering a SPOT (or at least as soon as possible) then put the tag
for that sound first before the other <CREATE> tags.
Add a sound to your spot <CREATE SYMBOL="~" BLOCK="SOUND"> <CREATE SYMBOL="c" BLOCK="ceiling"> Change Level 2 to look like this:
<LEVEL NUMBER="2"> And change Level 3 to look like this: <LEVEL NUMBER="3"> Save your file and open it in your browser. Go up to the roof of the
spot, move around and listen to the different ways the sounds work. You
should be able to hear 3 different sounds: the constant ambient sound
(unless you took this tag out), the guffaws that you hear intermittently
and are louder if you are close to a smiley, and the giggle that plays
at a constant volume throughout the area.
|
Copyright 1999, 2000 Flatland
Online, Inc.