Check if sound is playing/finished events

There should be conditions related to the progress of a sound, whether its a specific one or just checking if any sounds are playing on a channel.

I’m trying to make an event block that says that an object can only be clicked when a sound is done playing, but said sound increases in speed by 10% every time (with a maximum of 300% speed) and it seems way too complicated to make a complex equation inside of a “wait X seconds” event.

In the simplest way possible, it could be like the “play sound” block on scratch. The play a sound on Gdevelop is more like Scratch’s “start sound” block, which plays the sound and then continues. Play sound waits for the sound file to finish playing before the block continues.

if anyone wants to do the math and write the equation anyway, the audio in question’s length is roughly 3.5 seconds.

1 Like

There are no native events that will check which sound is playing on a channel, but there are event conditions that specifically check if a sound is playing on a channel, it’s explicitly called ‘sound is playing on channel’ in the event sheet, or ‘a sound is being played’ in the condition list.

Just ensure you use a dedicated channel for specific sounds (i.e. use channel 0 only for BG music, channel 5 only for player jump sounds, etc) and then you could just use ‘sound is playing on channel 5’ inverted to test if a sound is no longer playing.

1 Like

Genuinely no idea how I missed that lol, thanks

2 Likes