From 61c4ce272c6c74a0e46a75a3cb488bc5600e0767 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sun, 28 Jul 2024 11:47:25 +0200 Subject: [PATCH] [Web] Gracefully handle non-finite audio volumes --- platform/web/js/libs/library_godot_audio.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/web/js/libs/library_godot_audio.js b/platform/web/js/libs/library_godot_audio.js index 66d0d3d79dc..f1f02df9858 100644 --- a/platform/web/js/libs/library_godot_audio.js +++ b/platform/web/js/libs/library_godot_audio.js @@ -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; + } } /**