core: Fix some corrupted audio by preventing negative volume#23499
Open
iscwDu wants to merge 1 commit intoruffle-rs:masterfrom
Open
core: Fix some corrupted audio by preventing negative volume#23499iscwDu wants to merge 1 commit intoruffle-rs:masterfrom
iscwDu wants to merge 1 commit intoruffle-rs:masterfrom
Conversation
Member
|
Can you add a test for it? See for details:
We'd probably need a test that sets negative volume and then reads it back and plays audio. Then we can verify if the audio is playing. This way you'll know whether that's the right place to fix it and whether you should clamp it or abs it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #16234
I'm not a rust programmer, if there is a more idiomatic way to do this, please let me know. Thanks! (Edit: I did compile and run this against SDT to confirm that it fixes the audio issues, with and without '--release' )
I also wasn't sure if negative volumes should be clipped to zero or just treated as positive. This makes more sense to me as it looks like they could arise when doing some weird audio panning.