Skip to content

Return the length of the playing stream for AudioStreamRandomizer #105952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JulianHeuser
Copy link
Contributor

Fixes #105929
Fixes #104684

@JulianHeuser JulianHeuser requested a review from a team as a code owner April 30, 2025 15:27
@Mickeon Mickeon added this to the 4.5 milestone Apr 30, 2025
@Mickeon
Copy link
Member

Mickeon commented Apr 30, 2025

We should probably question what get_length() should generally return for AudioStreamRandomizer. (see #105954 💦). This looks ideal specifically for AudioStreamInteractive, but it may be entirely unexpected when fetching the length without intending to play the AudioStreamRandomizer first.

@Mickeon

This comment was marked as resolved.

@JulianHeuser
Copy link
Contributor Author

JulianHeuser commented Apr 30, 2025

Either way, can you actually confirm this fixes #104684 ?

Yes, I've tested it and it plays everything in sequence as expected, so it's definitely caused by the same issue.

I see the problem though - It would be a bit unclear if get_length changes its value based on the state of the stream, but it also doesn't make sense for it to be static on streams that can have variable length. The same issue is present for AudioStreamInteractive. I think for consistency, it makes more sense to return the length of the currently playing stream rather than the max length, since there are a lot of cases where users will need to use streams of variable length with AudioStreamInteractive. If someone wants to get the max length of all streams, they can do that in code, or we can make a helper function for the types of streams that could use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants