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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 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 |
I had the same error here. It looked like it was happening when I was doing my housekeeping / memory cleanup -- and re-initializing audio.
The problem was solved with audio.stop() prior to housekeeping / reinitializing audio.