mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-24 18:44:20 +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
|
second_sample = not second_sample
|
||||||
if freq == sfxr.FREQ_22050 and second_sample then
|
if freq == sfxr.FREQ_22050 and second_sample then
|
||||||
-- hah!
|
-- hah!
|
||||||
return iter()
|
local nsample = iter()
|
||||||
|
if nsample then
|
||||||
|
return (ssample + nsample) / 2
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- bit conversions
|
-- bit conversions
|
||||||
|
Loading…
Reference in New Issue
Block a user