Skip to content

Commit 8fd9958

Browse files
committed
Merge pull request #94869 from AThousandShips/web_volume_fix
[Web] Gracefully handle non-finite audio volumes
2 parents 5271a39 + 61c4ce2 commit 8fd9958

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

platform/web/js/libs/library_godot_audio.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,10 @@ class Bus {
858858
* @returns {void}
859859
*/
860860
setVolumeDb(val) {
861-
this._gainNode.gain.value = GodotAudio.db_to_linear(val);
861+
const linear = GodotAudio.db_to_linear(val);
862+
if (isFinite(linear)) {
863+
this._gainNode.gain.value = linear;
864+
}
862865
}
863866

864867
/**

0 commit comments

Comments
 (0)