Skip to content

core: Fix some corrupted audio by preventing negative volume#23499

Open
iscwDu wants to merge 1 commit intoruffle-rs:masterfrom
iscwDu:master
Open

core: Fix some corrupted audio by preventing negative volume#23499
iscwDu wants to merge 1 commit intoruffle-rs:masterfrom
iscwDu:master

Conversation

@iscwDu
Copy link
Copy Markdown

@iscwDu iscwDu commented Apr 20, 2026

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.

@kjarosh
Copy link
Copy Markdown
Member

kjarosh commented Apr 21, 2026

Can you add a test for it? See for details:

  1. https://github.com/ruffle-rs/ruffle/blob/master/CONTRIBUTING.md#test-guidelines
  2. https://github.com/ruffle-rs/ruffle/blob/master/tests/README.md

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.

@Lord-McSweeney Lord-McSweeney added A-audio Area: Audio A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) labels Apr 21, 2026
@kjarosh kjarosh removed the A-core Area: Core player, where no other category fits label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-audio Area: Audio T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NSFW] Dangerous audio corruption in early Super Deepthroat

3 participants