Error message in terminal: ALmixer_FreeData: alDeleteBuffers failed. Invalid Operation

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]

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.

[import]uid: 40285 topic_id: 10985 reply_id: 43857[/import]

Jroven

Could you put some sample code about your housekeeping / re-initializing audio routine?

I have the same error even when I use audio.stop().

Thanks

Flavio [import]uid: 3022 topic_id: 10985 reply_id: 58125[/import]

local cleanSounds = function()

audio.stop()
if fallingsound then
audio.dispose( fallingsound )
fallingsound = nil
end
if chesthitsound then
audio.dispose( chesthitsound )
chesthitsound = nil
end
if headhitsound then
audio.dispose( headhitsound )
headhitsound = nil
end
if cheerssound then
audio.dispose( cheerssound )
cheerssound = nil
end
if(leghitsound) then
audio.dispose( leghitsound )
leghitsound = nil

end
end
try to clean the sounds in cleanfuction and call it in clean() function
[import]uid: 95072 topic_id: 10985 reply_id: 67457[/import]