-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Uncaught TypeError: AudioParam.value setter error in Web build. #94806
Comments
Please confirm with rc1, a lot of web related issues were fixed since beta3 |
Is this just a warning or error popping up? Does it affect anything? Is audio working correctly otherwise? |
It crashes the game. I apologize in advance for being so difficult on my explanations and helping figure this all out, I genuinely am not sure precisely what causes it so I don't know where to begin with an MRP, but I can confirm that reverting back to beta1 (wasn't beta2, my mistake) has everything work just fine. Here's the error in full when the crash occurs. The crash occurs when the game is fading out volume, loading up a new song, then fading volume back in, basically just a music transition. Let me know what else I can do to help figure this out. EDIT: And by crash, I mean the game freezes. I'm assuming that's the same thing, but wanted to throw it out there just in case. I also just tried rc1, no change unfortunately. This error is on rc1, in fact. |
Oh yeah it crashing is very different from what you said in your description, important detail to mention at first Edit: freezing is not crashing, though I guess it depends on web |
Are you putting the audio source very very far away? Or is it assigned an invalid transform? For example setting some scale to 0? Or is the audio listener right on top of the audio source? CC @adamscott |
For sake of thoroughness (though I apologize if it's a lot of unnecessary info), this is what I'm doing roughly when it occurs. I'm setting music like this:
Where "events" is an AutoLoad and "events.event_music" is a dict of preloads, like this:
Where "helpers" is an AutoLoad and in the "helpers" func that's called, it does this:
Inside "helpers", there's this:
If I had to guess, this is where the problem is. I'm sure my method for handling this isn't ideal, but none-the-less it did work before and now does not. When a song is stopped, I'm just setting "event_song" back to null. I have a "music" AutoLoad arranged like this: ...which in the "music" script, is instantiated like this:
Again I'm sorry if I'm wasting your time with a bunch of nonsense, just trying to help narrow what this could be for you. |
I apparently don't know how to do proper code blocks on GitHub either, but I'm hoping you can make sense of where I was trying to do them. |
Can't see anything obviously wrong with this, so we'll see what the web team might find |
Have you made sure the |
I don't actually know what them being finite means. They're reset to 0.0 if below 0 and 1.0 if above 1. global.volume_division is:
|
Finite means not |
Sorry for the delay. volume_division may as well be a const as it's never changed anywhere. I double-checked my code to confirm this and ran print statements, it's initialized at 4 and remains 4 at all times. It is finite. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
After some testing I think I've pinned this down to user error You have provided a negative value to if global.event_volume_mult > 0.0:
global.event_volume_mult -= 0.01 If if global.event_volume_mult < 1.0:
global.event_volume_mult += 0.01 If So while we should probably investigate how to improve this this is a case of user error, my bad for the false hint of the So not marking this as critical as it doesn't happen with properly handled input and we can work out how to fix this down the line To ensure this works you should instead check if the value is greater than Leaving open for further discussion on how to resolve the rest, but not considering this critical for 4.3 as it is avoidable with proper value safety Will see about writing up a temporary fix maybe to handle invalid values being passed, or catching the error, but not sure if it should be done directly Edit: Also the reason this fails for you and yields a negative input is because of floating point error, performing |
Will write up a quick fix by adding a try/catch handling the error and just not updating anything, should be safe enough and prevent any errors Edit: Done, added a try/catch to handle it gracefully, now the volume is just ignored with a message if it is an invalid input |
You can add syntax highlighting by adding gdscript to the code block:
|
To clarify separately from my wall of text why I classify this as non-critical: |
@TheFoxKnocks Next time, please join an MRP to the issue. |
Thanks for the help! As stated in my original post, there's a reason why I was unable to do this. I can't make an MRP of something where I'm not particularly sure what the problem is exactly. Either way, a try/catch is a good solution and it seems like my issue isn't a bug, more that something that simply happened to work in a previous beta and with updates now no longer works. I'll adjust my code accordingly. |
Tested versions
Error occurs in v4.3.beta3.official [82cedc8]
Error did not occur in 4.3.beta2
System information
Godot v4.3.beta3 - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.3623) - 12th Gen Intel(R) Core(TM) i9-12900KF (24 Threads)
Issue description
When playing the game on a web browser (such as itch.io), sometimes playing different audio causes this error. I don't really have a reliable way to reproduce this and I know this is super vague, but I wanted to bring it up regardless as this did not happen in 4.3beta2, but does happen in 4.3beta3.
The error in full is as thus:
Blocking on the main thread is very dangerous, see
Uncaught TypeError: AudioParam.value setter: Value being assigned is not a finite floating-point value.
Steps to reproduce
N/A
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: