Distributed Sound
-
Basics
-
Running this demo
In a cluster system it make sense to provide a the sound by one dedicated server. This server has to be in the loop of the distributed simulation, because it may cause events whenever a sound ends. This is considered in the OAW framework by handling the sound manager as an interface that produces events that have to be distributed. Therefore the main step to make an OAW component ready to participate in a simulation with sound is to assign the sound manager as an distributed interface to the event broker.
pEB->AssignInterface("sound_manager",world.m_pSoundManager);
Now you can assign this interface active to the ScriptSrv component in the master.ini file
sound_manager ScriptSrv
The demo of this tutorial uses the ScriptSrv component from the OAW-projects section. The executable should be in the bin folder of the OAW root folder. So if you included the bin folder into the search path of your system, you may start the demo of this tutorial by executing the components on a console in the "OAW-tutorials/sound" folder like follows:
console1>glutCyberleSrv -inifile gsrv.ini
console2>ScriptSrv -use_al
console3>OAWMaster master.ini
The ScriptSrv component is started with the option "-use_al" to enable OpenAL sound support for this component.
This demo loads a little interactive cartoon that uses events of sounds to control the animation.
Start the animation by clicking on the figure in the scene. A script node in the VRML scene controls the animation and uses the events of the audioclip node to synchronize the animation. By this after some time the figure will plead you to click again on something.
You may see from the messages the components print on their consols, that only the ScriptSrv components loads the sounds. So you only need sound capabilties on the workstation in the cluster that serves as a sound server.