Forum

SoundFX: What's the best way to detect if sfx.play() has finished playing a speaker object?

16 November 2017 20:28
There seem to be no callbacks fired by sfx.play(), and no sensors for sound in general. Maybe I'm missing something because almost every other event in B4W has a callback upon termination.

I only found sfx.is_playing(obj), so I would have to hook that into a frame callback if there is nothing else.

Is there a better/simpler/more convenient way to do it?
17 November 2017 11:26
Hello!
Currently calling of is_playing method every frame is the only way to detect the end of a sound playback.
Alexander (Blend4Web Team)
twitter
17 November 2017 18:53
Thanks Alexander, I'll use is_playing then.
 
Please register or log in to leave a reply.