I'm having a little trouble with playing sounds and I hope you can help me out. The following works fine:
Code: Select all
saythisnumber = love.audio.newSource("audio/0.mp3", "static")
love.audio.play(saythisnumber)
Code: Select all
if numbertosay == 0 then saythisnumber = love.audio.newSource("audio/0.mp3", "static") end
love.audio.play(saythisnumber)
What I was actually *trying* to do, but generates the exact same error, is:"Incorrect parameter type: expected userdata."
Code: Select all
Now = os.date('*t') --get the date/time
hour = tostring(Now.hour) -- this works, assigns value XX to 'hour'
minutes = tostring(Now.min)
seconds = tostring(Now.sec)
sayhour = ("snd" .. hour) -- this works, generates a string that contains "sndXX"
sayminutes = ("snd" .. minutes)
sayseconds = ("snd" .. seconds)
love.audio.play(sayhour)
What am I doing wrong? Any help would be greatly appreciated!