Added Sound.play

This commit is contained in:
nucular 2014-05-26 20:25:10 +02:00
parent e2b2cf5e4b
commit 51e8617ef7

View File

@ -457,6 +457,16 @@ function sfxr.Sound:generateSoundData(freq, bits)
return data
end
function sfxr.Sound:play(freq, bits)
local data = self:generateSoundData(freq, bits)
if data then
local source = love.audio.newSource(data)
source:play()
return source
end
end
function sfxr.Sound:randomize(seed)
if seed then setseed(seed) end