Getting playback time from AudioStreamPolyphonic.

Godot Version

v4.4.1.stable.official [49a5bc7b6]

Question

I’ve been playing around with the idea of dynamic music that also triggers events in the world and loops/transitions seamlessly between tracks. I’ve been using an AudioStreamPolyphonic to mix the levels of music together and approximating the playtime worked pretty well until I started adding slow effects to the music based on player actions. I’ve looked at other forum posts which suggest using .get_playback_position() on both the audio player and stream but this only seems to return 0.0 for a AudioStreamPolyphonic regardless of how long it’s been playing. Is there a different way to get the play time or is this feature just missing from AudioStreamPolyphonic? I also noticed there doesn’t seem to be a way to get the stream length either, which would also be very helpful.

Preferably, I’d like to to be able to get the playback time and length for each stream making up the AudioStreamPolyphonic individually.

I don’t think there’s a way to get the playback position from a polyphonic player; it would have to hand back an array, since you may have multiple sounds at different playback positions. If you want to control individual sounds, you probably need to use non-polyphonic players.

2 Likes

That’s too bad, I could handle working with an array, but having no option to get the stream times in a polyphonic stream is a bit of a bummer, thank you for the reply.