Play a sound, then another when the first is finished? I want to play an intro sound, then when the intro is finished, play the full looped song.

What is the best strategy/tactic? Delay the playing of the loop by the lenght of the intro? Detect when the intro actuator has finished its job?


Play this audio file first: A "always" sensor connected to a "And" with use_priority connected to a "play_end" sound actuator
Then, connected to the same always sensor but with a regular AND python module connected to a "Loop_end" sound actuator :


.

def menuMusic(cont):
    loop = cont.owner.actuators["Loop"]
    time.sleep(0.5) # delays for 5 seconds
    cont.activate(loop)


But both my files are playing (in perfect sync, I must say)...
Here's what I ended up doing: there's a property time that I did not know about: Timer. I then set a property sensor to track this "Timer" value, but the "equal" eval type did not work, I had to use "interval" and set my interval using the right n.000000 notation. By precisely tuning the Minimum value, I managed to get a sample-perfect intro+loop sequence.