FunkinCrew / Funkin

A rhythm game made with HaxeFlixel
https://www.newgrounds.com/portal/view/770371
Other
2.98k stars 2.29k forks source link

Bug Report: Game audio is still audible even when volume tray is set to 0% #3394

Open Blue2359 opened 2 months ago

Blue2359 commented 2 months ago

Issue Checklist

What platform are you using?

Itch.io (Downloadable Build) - Windows

If you are playing on a browser, which one are you using?

None

Version

0.5.0

Context (Provide images, videos, etc.)

Okay, I have no clue how I even managed to notice this, lol.

I guess there's an issue with how the volume management system works in the game; when your volume slider percentage is at 0% (WITHOUT BEING MUTED), you can still slightly hear the game, this is also the same case across all other builds; (Web, Desktop... & etc). image

Steps to reproduce (or crash logs, errors, etc.)

No response

Hundrec commented 2 months ago

Whoa, you're right!

https://github.com/user-attachments/assets/535f4f96-c695-465e-90b2-731cb8115a89

NotHyper-474 commented 2 months ago

This is likely related to these changes to Funkin's Flixel sound tray

Blue2359 commented 2 months ago

It's probably this change here that causes the problem. image

~... Which meannssss, this is not a funkin problem, rather a flixel problem~ Edit: nvm, just noticed that this is from the FunkinCrew flixel fork actually, so it IS a funkin problem...

Keoiki commented 2 months ago

Make the volume scale logarithmically, that'll be good, they thought. Look who can't reach 0 volume without the mute key! image

lemz1 commented 2 months ago

it has something to do with this function:

    public function linearToLog(x:Float, minValue:Float = 0.001):Float {
        // Ensure x is between 0 and 1
        x = Math.max(0, Math.min(1, x));

        // Convert linear scale to logarithmic
        return Math.exp(Math.log(minValue) * (1 - x));
    }

since you cant take the log of 0 you are required to have some small value above 0. so i guess you are just forced into using the mute key.

or we could force it to be 0 if x is equal to 0

Hundrec commented 2 months ago

I'm no coder, but I'd think to just insert a conditional somewhere in there making sure that a linear volume of 0.0 sets the actual volume to 0%

(Or what you did in your PR, that looks legit)

EliteMasterEric commented 1 month ago

Added a fix for this in a branch that's pending merge

Blue2359 commented 1 month ago

Didn't mean to close this issue, whoops

Keoiki commented 1 month ago

Still not fixed in 0.5.1.

EliteMasterEric commented 1 month ago

Still not fixed in 0.5.1.

I'm confused why you say it's not fixed because I literally fixed it.

NotHyper-474 commented 1 month ago

https://github.com/user-attachments/assets/4ceeb618-4e79-43f9-a84a-6a7d7bd6467b

Can confirm it's still not fixed. Just like before, muting with 0 works, but decreasing to 0% with - does not.

Keoiki commented 1 month ago

Still not fixed in 0.5.1.

I'm confused why you say it's not fixed because I literally fixed it.

I'm still able to hear audio at 0% myself (even OBS volume bars show movement), remember this isn't about the Mute key. Probably the easiest way to listen for audio at 0% is in the character select screen.

or just, y'know, set your PC's volume to 100% when the game is at 0% and you'll be able to hear it more clearly.

Also the fix done in the flixel fork presumably, but I can't find any commits fixing this.

Blue2359 commented 3 weeks ago

This issue is still present in v0.5.3 btw

ninjamuffin99 commented 1 day ago

should have a fix for this internally now!
seems like my log/linear math didn't account for taking in a 0 value, so it would always do the math with a value of 0.001 or something (since log() doesn't accept a non-zero input)

for those curious on the fix, should be in our FunkinCrew/flixel dev-6.0.0-latest branch, one of the recent commits as of writing
when this issue is marked as closed, it means it should be merged internally 🙂