Game Development Reference
In-Depth Information
Listeners and Emitters
Whereas the listener is what picks up the sound in the world, the emitter is what
actually emits a particular sound effect. For example, if there is a fireplace that
crackles, it will have a sound emitter placed at its location that plays back the
crackle cue. Then based on the distance between the listener and the fireplace's
sound emitter, it would be possible to determine how loud the sound should be.
Similarly, the orientation of the emitter relative to the listener will determine
which speaker the sound should be heard from. This is shown in Figure 6.2 .
Figure 6.2 Sound listener and emitter; in this case, the sound effect should be
heard on the right.
Because the listener picks up all the audio in the 3D world, determining the po-
sition and orientation of the listener is extremely important. If the listener is not
set appropriately, the rest of the 3D sound system will not work properly—either
sounds will be too quiet or too loud, or sounds might even come out of illogical
speakers.
For many types of games, it makes sense to have the listener directly use the po-
sition and orientation of the camera. For example, in a first-person shooter, the
camera is also where the player's point of reference is, so it makes perfect sense to
have the listener use that same position and orientation. The same can be said for
a cutscene where the camera is following a set path; the listener can just update as
the camera updates.
Although it may be tempting to always have the listener track the position and ori-
entation of the camera, there are certain types of games where this will not work
properly. Take, for instance, a third-person action game. In such a game, the cam-
era is following the main character at a distance. Suppose in one particular game,
Search WWH ::




Custom Search