When I use audio.dispose( tapSound ) and tapSound = nil, I get these errors:
ALmixer\_FreeData: alDeleteBuffers failed. Invalid Operation
and
malloc: \*\*\* error for object 0x5a61f4: incorrect checksum for freed object - object was probably modified after being freed.
\*\*\* set a breakpoint in malloc\_error\_break to debug
After hunting around for an answer, it looked like I had to stop the sound before disposing it and setting it to nil by using audio.stop(). Now, with audio.stop(), the background music is getting snuffed out. Here’s some of the relevant code I’m working with if anyone can help me out:
-- AUDIO
intromusic = audio.loadStream( "intromusic.mp3" , true)
audio.play( intromusic, { channel=1, loops=-1 } )
local tapSound = audio.loadSound( "button.mp3" )
[code]local onPlayTouch = function( event )
if event.phase == “release” and playBtn.isActive then
audio.play( tapSound, { onComplete=audio.stop( tapSound ) } )
audio.dispose( tapSound )
tapSound = nil
cleanGroup( menuGroup )
menuGroup = nil
director:changeScene( “levelselection” )
isLevelSelection = true
isOFButton = false
isMoreSection = false
end[/code]
The intro music ought to continue into the “levelselection” screen but stops. In the game, I have this same situation going on and when you move on to the next level, all the sound fx are gone.
Also, if you’re taking a looking at this and see that I’m using that ‘cleangroup’ incorrectly, please let me know. I’ll put up another post regarding that issue separately though.
Thanks!
VanDono - Ratatat Graphics [import]uid: 14032 topic_id: 8977 reply_id: 308977[/import]