-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Web] Gracefully handle non-finite audio volumes #94869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can handle this case more gracefully than a try/catch. I'll try something in the following hour.
I'll switch to a |
80110f8
to
bb0bd27
Compare
bb0bd27
to
61c4ce2
Compare
Now just ignores the value if non-finite after converting Moving this to But think a targeted fix would be appropriate here and looking at a broader fix with the possible implications later |
To confirm this just try running: AudioServer.set_bus_volume_db(0, +INF) and (separately): AudioServer.set_bus_volume_db(0, NAN) This will error out and fail to run, with a popup of the error With this fix, and specifically with |
Here's an MRP to test with, check the script for instructions: My bad uploaded wrong project: |
@AThousandShips Are you sure you joined the right MRP? There's no script at all. |
It's built-in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @AThousandShips. I didn't know that it was the WebAudio gain node that was complaining about Infinity
.
So, everything's good, I'll add a warning later, that I must implement in the JS stack.
Thanks! |
Thank you! |
These values aren't valid but they should be handled gracefully,
could handle with aisFinite()
instead (though that would involve checking after converting, so bit more complex code), with or without a message, but I think this is the most straight forward way to handle itThis shouldn't happen with properly handled input, but in case of user error entering invalid values we should handle this gracefully instead of failing to load