on Mar 14th, 2010, 9:02pm, Guest-leslie griffin wrote:is there a way to get a program to flow normally while executing a sound command. |
|
Of course. Sounds are played asynchronously and sound 'events' are queued so that you can play (for example) music to accompany a program without it pausing.
The only time a SOUND statement will stall a program is if the queue for that channel is already full; you can test for that condition using ADVAL. If you only ever issue a SOUND statement when there is space in the queue for that channel, it won't stall. Conceptually you can do that using code such as the following:
Code: IF ADVAL(-6) THEN SOUND 1,level,pitch,dur
For example suppose you were reading the sound parameters from DATA statements, you could then do:
Code: IF ADVAL(-6) THEN
READ level,pitch,dur
SOUND 1,level,pitch,dur
ENDIF
It gets a little more complicated if you're using more than one channel, but hopefully you get the idea.
Richard.