Merge pull request #94869 from AThousandShips/web_volume_fix

[Web] Gracefully handle non-finite audio volumes
This commit is contained in:
Rémi Verschelde 2024-07-30 12:28:58 +02:00
commit 8fd99580d5
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 1 deletions

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;
}
}
/**