Let's take a concret example. I've a FPS game where the player shoots laser beams (slow, with a begin and an end like in star wars). This projectile eventually hits a wall and then make a sound when it disappears.
Written like that, that seems easy to do. But technically in Godot, it's far from obvious.
I have to use a SpatialSamplePlayer because it must be played at the collision point. It cannot be part of the projectile node because this node is being queue_freed when the sound starts to play (and the player wouldn't hear anything).
Then I try to create a SpatialSamplePlayer in the global scene and move it to the collision point. However I don't know when the sample is done playing. There's no signal and no option to know the length of the current sample. About the object Sample, there is a get_length method but it gives a number, without unit, that makes no sense. The online documentation says to multiply or divide by two, depending on the format, but that doesn't give me the real length of the sample.
Does someone know how to play a spatial sound and simply kill it when it's done?