Use interpolation instead of skipping a sample when generating for 22050 Hz

This commit is contained in:
nucular 2014-05-08 16:21:26 +02:00
parent c3b2a0eec3
commit 0b3049d054

View File

@ -386,7 +386,12 @@ function sfxr.Sound:generate(freq, bits)
second_sample = not second_sample
if freq == sfxr.FREQ_22050 and second_sample then
-- hah!
return iter()
local nsample = iter()
if nsample then
return (ssample + nsample) / 2
else
return nil
end
end
-- bit conversions