Page 1 of 1

wait for playsound

Posted: Sat Feb 23, 2008 3:02 am
by Killerdude
Is there a way to wait until playsound is done before loopsound is called?

Code: Select all

fan_start_sound:
    $fancone playsound snd_fan_start
    $fancone loopsound snd_fan_loop
end
I figure I can always put playsound in another thread and do this ......

Code: Select all

fan_start_sound:
    waitthread fan_start  // thread that plays the snd_fan_start
    $fancone loopsound snd_fan_loop
end
Just curious if there is a better way ;)

Posted: Sat Feb 23, 2008 4:30 am
by tltrude
The simple way would be to just put in a wait that is as long as the sound plays -- trial and error.

Code: Select all

fan_start_sound: 
    $fancone playsound snd_fan_start
    wait 1.5
    $fancone loopsound snd_fan_loop 
end