Skip to content

Commit

Permalink
Merge pull request #94869 from AThousandShips/web_volume_fix
Browse files Browse the repository at this point in the history
[Web] Gracefully handle non-finite audio volumes
  • Loading branch information
akien-mga committed Jul 30, 2024
2 parents 5271a39 + 61c4ce2 commit 8fd9958
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platform/web/js/libs/library_godot_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/**
Expand Down

0 comments on commit 8fd9958

Please sign in to comment.