Complete coding novice here and I think I'm missing something basic about the way that either require or threads work.
I'm trying to make use of Zorg's excellent "advanced sound library" (asl) found here.
I've checked that the asl.lua and asl-thread.lua are both run correctly by inserting a basic print("Did this") command in each and yes, they run.
But when I try to call the function Source:setTimeStretch(2.0) I get the following error:
Code: Select all
Error: main.lua:201: attempt to call method 'setTimeStretch' (a nil value)
stack traceback:
[love "boot.lua"]:345: in function 'setTimeStretch'
main.lua:201: in function <main.lua:181>
main.lua:152: in function 'update'
main.lua:39: in function <main.lua:12>
[C]: in function 'xpcall'
[love "boot.lua"]:361: in function <[love "boot.lua"]:348>
[C]: in function 'xpcall'
Code: Select all
tSPEECH[gSPEECH_PLAYING] = love.audio.newSource("cache/line"..gSPEECH_PLAYING..".mp3", "static")
tSPEECH[gSPEECH_PLAYING]:setTimeStretch(2.0)
tSPEECH[gSPEECH_PLAYING]:play()