From d7c314dc18b69bef1047f30a70a6f153e11c9ce2 Mon Sep 17 00:00:00 2001 From: nucular Date: Sun, 25 May 2014 23:05:02 +0200 Subject: [PATCH] Fix volume application --- sfxr.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfxr.lua b/sfxr.lua index 5b873d8..45f8dd2 100644 --- a/sfxr.lua +++ b/sfxr.lua @@ -376,8 +376,8 @@ function sfxr.Sound:generate(freq, bits) end -- Apply the volumes - ssample = ssample / self.superSamples * self.volume.master - ssample = ssample * 2 * self.volume.sound + ssample = (ssample / self.superSamples) * self.volume.master + ssample = (ssample * 2) * self.volume.sound -- Hard limit ssample = clamp(ssample, -1, 1)