Waiting for Sound
Posted: Mon Oct 26, 2015 5:53 pm
I am implementing multiple image changes (like a looping slide show) while waiting for an audio clip to finish. Initially I was doing this loop while checking for "wait until the sound is done with messages". However, it is quite possible I am mistaken, I found that the program was sluggish and not responsive. So, I changed to the following code for 10 second duration loops for the image changes, frequently checking for the sound to be finished (rather than using "wait until the sound is done with messages"). Does this make sense or is there an easier way to implement code while waiting for audio, while being very responsive to touch commands?
Code: Select all
on waitForAudio
repeat with t=0 to 200
wait 0.05 second with messages
if the sound = "done" then exit repeat
end repeat
end waitForAudio