Skip to content

Handle invalid AudioStream playback positions#119446

Open
Akosmo wants to merge 1 commit into
godotengine:masterfrom
Akosmo:handle-invalid-seek
Open

Handle invalid AudioStream playback positions#119446
Akosmo wants to merge 1 commit into
godotengine:masterfrom
Akosmo:handle-invalid-seek

Conversation

@Akosmo
Copy link
Copy Markdown
Member

@Akosmo Akosmo commented May 14, 2026

What problem(s) does this PR solve?

Additional information

This pull request is an alternative to #119120 , where instead of seek() and play() functions allowing invalid playback positions, and just setting them to 0, they instead stop playback and return with an error message. This alternative exists after it was discussed in an audio meeting that invalid playback positions should be handled with an error, so the user can handle possible unexpected values.
I changed the order of some lines in the start() function of AudioStreamWAV, but it seems to function the same. I did this to avoid code repetition.
I tested this by using both functions directly in a player. I set the stream to Ogg, MP3, and WAV streams. I tried play with loop disabled and enabled, with loop offset and beat count at different values, and playing from the stream importer window too. Because of the large amount of cases, I could possibly have missed a case, but having dealt with this before on the other PR, I believe everything looks fine.

Read this PR for more info about my original attempt at fixing the issue, and why I'm handling it in the seek() function

@Akosmo Akosmo requested a review from a team as a code owner May 14, 2026 00:19
@Akosmo Akosmo force-pushed the handle-invalid-seek branch from 0df199e to d7ff48b Compare May 14, 2026 00:23
@Akosmo Akosmo changed the title Handle invalid playback positions Handle invalid AudioStream playback positions May 14, 2026
@AThousandShips AThousandShips added this to the 4.x milestone May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment