Hi is there a way to listen to a sound finishing playing?, and then executing a callback?. I was looking for some signal to connect to, but i couldn't find it.
If there isn't would doing something like this be good?
var started_playing
var last_sound
func _ready():
started_playing = false;
MySampler.add_user_signal("sound_finished", [{"sound": TYPE_STRING}]);
set_process(true);
func play_sound(key):
MySampler.play(key);
started_playing = true;
last_sound = key;
func _process(delta):
if(!MySampler.is_active() && started_playing):
emit("sound_finished", last_sound);
started_playing = false;
Might have some syntax errors couse i wrote it directly here, but asking if the generla idea es correct and any who has experience in this feel free to advise me, thanks!.