Fix stream sync play and seek setting wrong position on certain cases #100292
+32
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you have multiple streams on AudioStreamSynchronized with different lengths, start and seek methods will unsync the sound when position set is higher than one of the stream's length.
Example: if AudioStreamSynchronized has two streams, one with a beat sound with a length of 16s and the other with a base sound with a length of 32s and you call audio_player.play(20) or audio_player.seek(20), the first one will start at position 0, while the other one will start at 20.
You can reproduce this issue here with detailed informations running the scene stream_sync_play_and_seek_not_setting_position_right_sometimes