From 12b7327ff209a23726cef1c7dc52775d57138e92 Mon Sep 17 00:00:00 2001 From: Iliyas Jorio Date: Thu, 21 Aug 2014 14:33:16 +0200 Subject: [PATCH] Fixed issue #8 --- sfxr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfxr.lua b/sfxr.lua index c655ac2..c4c8d31 100644 --- a/sfxr.lua +++ b/sfxr.lua @@ -894,7 +894,7 @@ function sfxr.Sound:exportWAV(f, freq, bits) if bits == sfxr.BITS_16 then -- wrap around a bit if v >= 256^2 then v = 0 end - if v < 0 then v = 256^2 - 1 end + if v < 0 then v = 256^2 + v end w16(v) else f:write(string.char(v))