mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-05 11:34:21 +00:00
Use interpolation instead of skipping a sample when generating for 22050 Hz
This commit is contained in:
parent
c3b2a0eec3
commit
0b3049d054
7
sfxr.lua
7
sfxr.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user