ygSound derived from ygSoundServer Example Source Header

Description: creates a positional sound within a space using one of several file formats

notes:
Category: Sound
Author: Dave Pape
11/01/01
10/03/02 Dave Pape - Added 'start' event
Revision: 08/01/03 Alex Hill - added position reporting for spatialized sound server

    Messages
file file set the name of the sound file
loop [bool] set the sound looping mode
play [bool] start the sound playing with file and amplitude
stop [bool] stop the sound playing with file and amplitude
updateInterval float set the update interval for sound server
    Events
start the sound has started
stop the sound has stopped
    Comments

constructor ygSound

destructor ~ygSound

method reset

1 reset playing flag to false
2 reset loop flag to false
3 set current distance to 0.0
4 set update interval to 0.1
5 if a sample exists then delete it

method message

1 set the name of the sound file
2 set the sound looping mode
3 start the sound playing with file and amplitude
4 stop the sound playing with file and amplitude
5 set the update interval for sound server

method setFile

method setLoop

method setDistance

method setAmplitude

method setFalloffDistance

method setAttenuation

method isPlaying

method isPaused

method play

1 if no sample then create a new bergenSample
2 generate a heartbeat for the server
3 the sound has started

method pause

method stop

1 if a sample is playing
1.1 send a stop command to the server
1.2 the sound has stopped

method app

1 if a sample exists
1.1 generate a heartbeat for the server
1.2 if the sample is playing
1.2.1 if sample has stopped then stop
1.2.2 else, compute new amplitude
1.2.2.1 if update interval has passed then update sound server
1.2.2.1.1 determine position of this sound
1.2.2.1.2 get position relative to CAVE