Messages |
file | string | 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 | ||
stop |
Comments |
constructor ygSound
destructor ~ygSound
method reset
1 reset playing flag to false
2 reset loop flag to false
3 set start time to 0.0
4 set end time to 0.0
5 set current amplitude to 0.0
6 set update interval to 0.1
7 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 setCurAmplitude
method isPlaying
method play
1 if no sample then create a new bergenSample
2 play the sample
3 generate a heartbeat for the server
method stop
1 if a sample is playing
1.1 send a stop command to the server
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 is past end time and not looping 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