Game Development Reference
In-Depth Information
the stereo sound is perceived from the Audio Source within the 3D
Game space. High settings will result in the stereo channel separation
clearly being perceived, while low settings will tend to create more
of a monaural sound, although still distributed through the 3D audio
engine and 'heard' through the Listener.
Spread : The spread control is most useful for surround coni gurations
such as 5.1 or 7.1 surround systems. It governs how ef ectively the
separation of individual speakers will be perceived inside the game
from that Audio Source. Low settings will tend to make it sound more
centralized and toward the front, while higher settings will distribute
the sound more equally between all the speakers.
Let's now play our Scene so that we can hear the sound that we just put
in our Audio Source. First, make sure that you save your Scene—this is
going to be very important going forward. Then click the Play button at
the top to play our Scene and listen to the looped AudioClip we placed in
the scene as we walk around.
You'll recall the rule we specii ed last level that all changes to a Game Object
in the Scene during Play Mode are lost. Actually here's where we should
mention one signii cant exception of sorts, specii c to Audio Sources that
are set to both Loop and Play On Awake. First, make sure you're not playing
your Scene. Then look at the Scene View bar at the top. You might have
noticed a little speaker icon on the top bar towards the left.
Screenshot of audition mode icon.
Turning this on will automatically enable you to preview these Audio
Sources in the game itself, although you'll have to move your view
camera around to hear the ef ect of it. This can be a useful feature as you
can then set and edit your Min and Max Distances and try things out
before going into Game mode.
Triggering a Sound in Unity
Now, for our next trick, we're going to make it so that the character
walking around will run into a door, and that will trigger a sound. You
might recall in the last level, we talked about the importance of physics
inside a game engine. That's what I'm going to use in order to generate
 
Search WWH ::




Custom Search