From c01399d1f301a00e0cc0a0d2a8db84bb267633b3 Mon Sep 17 00:00:00 2001 From: Dima Pulkinen Date: Sun, 10 Nov 2024 19:14:32 +0200 Subject: [PATCH] default to 16 bit SoundData, but samples must always be set as floats --- sfxr.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfxr.lua b/sfxr.lua index 6c5fc4d..d594dbc 100644 --- a/sfxr.lua +++ b/sfxr.lua @@ -858,11 +858,11 @@ end -- @raise "invalid sampling rate: x", "invalid bit depth: x" function sfxr.Sound:generateSoundData(rate, depth, sounddata) rate = rate or 44100 - depth = depth or 0 + depth = depth or 16 assert(sfxr.SAMPLERATE[rate], "invalid sampling rate: " .. tostring(rate)) assert(sfxr.BITDEPTH[depth] and depth, "invalid bit depth: " .. tostring(depth)) - local tab, count = self:generateTable(rate, depth) + local tab, count = self:generateTable(rate) if count == 0 then return nil