Detect end of sound (SOLVED)

Get end sound in any way(message or callback)

You could always create a timer with the length of the intro and run in at the same time as the sound.

But maybe there’s a way to get the callback directly from the sound.

Yes i can, but for that i need to know sound lenght

Don’t you?

I actually did this myself when making Operator.

It turned out beautifully, but at the same time, it did require some hacking together to make alarm timings that managed to loop sounds. That is made a bit easier now with an actual built-in alarm (I had made one myself).

I’m told that FMOD is the best, if not the only sound manager asset for Defold. That might have some sort of “get sound length” feature. I might experiment with this.

We will make several improvements to audio playback during 2019. Getting a callback when a sound is finished is among them.

3 Likes

If you use FMOD it’s really easy to tell when a sound is playing or not.

if sound:get_playback_state() == fmod.STUDIO_PLAYBACK_STOPPED …

3 Likes

I look at fmod. But not try it yet. It looks big and complex, for me.

It is pretty easy once you get it. If you have questions ask me and I can help.

2 Likes

Solved in Defold 1.2.162 has been released

2 Likes