[Web] Gracefully handle non-finite audio volumes

This commit is contained in:
A Thousand Ships 2024-07-28 11:47:25 +02:00
parent 0e9caa2d9c
commit 61c4ce272c
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7

View File

@ -858,7 +858,10 @@ class Bus {
* @returns {void}
*/
setVolumeDb(val) {
this._gainNode.gain.value = GodotAudio.db_to_linear(val);
const linear = GodotAudio.db_to_linear(val);
if (isFinite(linear)) {
this._gainNode.gain.value = linear;
}
}
/**