If I have an AudioPlayer with a AudioStreamInteractive inside, I can switch the clip using audio_player.get_stream_playback().switch_to_clip(1), like described in this post: How do I switch AudioStreamInteractive clips in code?
But what if the AudioStreamInteractive isn’t directly inside an AudioPlayer, but inside another AudioStream (in my case AudioStreamSynchronized)? To use switch_to_clip() I need a playback. I can’t use get_stream_playback() on the AudioPlayer, that just gives me Playback of the parent stream. AudioStream has a instantiate_playback() function but if I understand right that creates a new Playback, not return the existing one.
The pull request describes similar cases so I think there must there should be a way to do this, but I can’t figure it out
As an example:
AudioStreamPlaylist insde of AudioStreamInteractive resembles how WWise does interactive music.
AudioStreamSynchronized inside of AudioStreamInteractive resembles how Elias does interactive music.
An anecdote from another project: I tried putting an interactive inside of another interactive. When I tried to switch_to_clip on the OUTER interactive, the transition rules were not respected. It switched immediately, not at the end of the clip as expected.
So it might be a lost cause, for now, to put an interactive inside of anything else.
Nope! I left a comment on the Github commit, I’ll see if someone responds, but I’m guessing the only current option is to create an AudioStreamPlayer for each AudioStreamInteractive.
The functionality is still relatively new so maybe this just wasn’t a use case that was considered, but I really hope it gets explained/fixed/added. The audio features would be extremely powerful if you could nest all differens kinds substreams (like you already can in the Inspector)
Totally agree. Btw I did see a not-yet-approved pull request to have the Audiostreaminteractive signal when it changes clip. There’s some good stuff coming down the pipeline.
Would it be appropriate to make an Issue on the GitHub about not being able to switch inner Audiostreaminteractives? It’s not exactly a bug, just sounds like a design oversight…