Hi all,
In my app I have audio files play based on a timer, and need the sounds to stop playing when changing to the next screen. The sounds play fine but when I go to clean it up I get this message in terminal:
[code]ALmixer_FreeData: alDeleteBuffers failed. Invalid Operation
–play sound file
local function myFF()
redsquare4.xScale = 1.5
redsquare4.yScale = 1.5
audio.play(red)
end
theTimer = timer.performWithDelay(9000,myFF)
–change scene:
local function winner()
if state == 1 then
–local function delay()
director:changeScene(“win”, “fade”)
timer.cancel(theTimer)
end
end
–clean up:
function clean ( event )
Runtime:removeEventListener(“enterFrame”, winner)
Runtime:removeEventListener(“collision”, objectCollision)
timer.cancel(theTimer)
audio.dispose(blue)
blue = nil
audio.dispose(red)
red = nil
print(“Cancelled:”)
end
[/code]
I tried using onComplete=audio.stop within audio.play which gives me a different error in terminal, but regardless the sounds playback just fine and the game will proceed normally. So, I must be doing something wrong any ideas/suggestions?
Thanks! [import]uid: 32253 topic_id: 10985 reply_id: 310985[/import]