mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-05 11:34:21 +00:00
But apparently it's faster this way :O
This commit is contained in:
parent
37e58ac6be
commit
09e552bdd5
10
sfxr.lua
10
sfxr.lua
@ -390,12 +390,12 @@ function sfxr.Sound:generateTable()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function sfxr.Sound:generateSoundData(freq, bits)
|
function sfxr.Sound:generateSoundData(freq, bits)
|
||||||
local data = love.sound.newSoundData(self:getLimit() + 1, freq, bits, 1)
|
local tab = self:generateTable()
|
||||||
|
|
||||||
local i = 0
|
local data = love.sound.newSoundData(#tab, freq, bits, 1)
|
||||||
for v in self:generate() do
|
|
||||||
data:setSample(i, v)
|
for i = 0, #tab - 1 do
|
||||||
i = i + 1
|
data:setSample(i, tab[i + 1])
|
||||||
end
|
end
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user