From d3bbedb30e45ed76d2685635dc054f1eacb190f4 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Mon, 13 Feb 2023 21:55:42 +0100 Subject: [PATCH] Bugfix volume not being actually clamped --- Capy64/Runtime/Libraries/Audio.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Capy64/Runtime/Libraries/Audio.cs b/Capy64/Runtime/Libraries/Audio.cs index 5180126..d64d30e 100644 --- a/Capy64/Runtime/Libraries/Audio.cs +++ b/Capy64/Runtime/Libraries/Audio.cs @@ -142,7 +142,10 @@ public class Audio : IPlugin var freq = L.CheckNumber(1); var time = L.OptNumber(2, 1); var volume = L.OptNumber(3, 1); - Math.Clamp(volume, 0, 1); + + + + volume = Math.Clamp(volume, 0, 1); var buffer = Core.Audio.GenerateSquareWave(freq, time, volume);