Add a way to get the current Stream at a playing AudioStreamRandomizer
Describe the project you are working on
A 2D game with background randomized soundtrack, I was trying to display the current playing music on UI.
Describe the problem or limitation you are having in your project
I don't see Any way I could get the current Stream playing at AudioStreamRandomizer?
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add any way to get the current stream resource playing when the AudioStreamPlayer is using a AudioStreamRandomizer
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Could be a property of the AudioStreamRandomizer resource.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I couldn't find any other solution beside not using the actual AudioStreamRandomizer and coding the random logic yourself.
Is there a reason why this should be core and not an add-on in the asset library?
Not having it makes AudioStreamRandomizer very limited to an scalable use.
- Related to https://github.com/godotengine/godot-proposals/issues/3307 (as knowing the current random song can be useful to display attribution).
I think the same logic should extend to other similar meta streams like AudioStreamPlaylist. It's good to know what's playing to allow displaying information regarding what's playing to a player, etc. If I'd want to show an audio player UI in a game I think currently I'd have to recreate/replicate AudioStreamRandomizer/AudioStreamPlaylist more or less completely just to add getting the current sub-stream index.
I was hoping I'd find a solution but alas I found this issue. Would love to see this, as it makes debugging sounds quite difficult.
Little addition: Would be nice if you could also dictate a specific sound to play again.
In my project i am saving the currently playing sound and it's timestamp dynamically, so it would be great to not only get the current playing stream, but also to play a specific stream again, when i load my savefile for example.