A SERVICE OF

logo

Playing Sound in Immediate Mode
177
Playing Sound in Immediate Mode
When a csSoundAction is invoked on a scene graph, the action traverses the scene graph
and gathers a list of active csSound nodes. The action noties csContext internally of this
list of nodes. When the context is applied to the rendering pipeline, the sounds specied
in the associated csAudioSamples nodes are played.
You can also play a sound le immediately. Instead of using a csSoundAction to trigger
the playing of the sound le, you use a csSoundPlayer node.
All of the code used to play sounds, either using csSoundAction or csSoundPlayer, is
encapsulated in csSoundPlayer. Consequently, all of the eld settings discussed
previously in this chapter also need to be specied in csSoundPlayer.
csSoundPlayer Methods
csSoundPlayer methods provide sophisticated control over the sound source and the
microphone recording the sound. Some of those controls include:
Position of the sound source and microphone.
Motion of the sound source and microphone; helpful in simulating a Doppler shift.
Scaling of the sound source intensity and frequency.
Number of recording channels.