How to find out when a sound ends?
ookami007
Member Posts: 581
Is there anyway to find out when a sound ends?
For instance, if I want to play sound A... and when sound A is finished, then sound B and then when sound B ends, play sound C...
Is that possible? Is there anyway to set an attribute upon sound completion?
Comments
There is no 'when sound ends' behaviour, but you can simply take the length of the sound and use a timer to trigger the next sound once the first has finished.
Hi @ookami007 I think a lot of GSC users (myself included) would love to have the ability to find out the length of any sound or music in GSC - but it's still not possible, unfortunately. (Maybe one day?)
So the only way to get this info is to open the sound file in an audio editor, or sequencer like GarageBand, etc., write down the length then, back in GSC, you can user a Timer set to After for the next track to play. (Adding up the time lengths as you go, for subsequent audio to play). Hope that helps.
Edit: @Socks beat me to it... :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
This is unfortunate. I guess I would need to have a table with all the sounds and all their lengths and then setup an additional table with the sounds the user picks... then as they are played, keep track of the time and set an attribute when it's time to switch to the next sound.
It really isn't that complicated, no real need for tables or attributes or for '[keeping] track of the time' !? (although you could do that if you wanted to).
I'd simply play sound A - then place sound B in a timer to start when sounds A ends, then place sound C in a timer to start when sounds B ends . . .
This is what I've done. It works great but does require the sound lengths to be entered as table data.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
That's only true when you have a set order for the sounds and you play the same sounds in exactly the same order. If the order is different every time... say, a roar and then a fireball one time and then a scream and a fireball the next time... you will need a table.