diff --git a/extensions/Lily/SoundExpanded.js b/extensions/Lily/SoundExpanded.js index cafbf734e5..821dffc40b 100644 --- a/extensions/Lily/SoundExpanded.js +++ b/extensions/Lily/SoundExpanded.js @@ -530,7 +530,7 @@ setProjectVolume(args) { const value = Scratch.Cast.toNumber(args.VALUE); - const newVolume = this._wrapClamp(value / 100, 0, 1); + const newVolume = Scratch.Cast.toNumber(Math.max(Math.min(value, 1), 0)); runtime.audioEngine.inputNode.gain.value = newVolume; } @@ -538,7 +538,7 @@ const value = Scratch.Cast.toNumber(args.VALUE) / 100; const volume = runtime.audioEngine.inputNode.gain.value; const newVolume = Scratch.Cast.toNumber( - Math.min(Math.max(volume + value, 1), 0) + Math.max(Math.min(volume + value, 1), 0) ); runtime.audioEngine.inputNode.gain.value = newVolume; }