[Resolved] audio.dispose bug

I use Storyboard.
In the function scene:createScene( event )
I load background music:
audio.play(mus, { loops=-1})
at the function scene:exitScene( event )
I do:

audio.dispose(mus)
mus=nil

but after game go to another scene piece of audio continues to play (looping)
Is it a bug or am I doing something wrong?
(Sorry, I badly know English :)) [import]uid: 122153 topic_id: 24050 reply_id: 324050[/import]

Hi flg,
I think you must stop the music first… audio.stop( channel )… before disposing it. Note that you must specify the CHANNEL that the music is playing on, not the handle “mus”.

This remark comes from the documentation on “audio.dispose()”

You must not use the handle once the memory is freed. The audio should not be active (playing or paused) on any channel when you try to free it.

Hope this helps!
Brent [import]uid: 9747 topic_id: 24050 reply_id: 96967[/import]

In fact, you should seeing a big fat error in your simulator when you try to dispose of an audio handle that’s currently playing. That’s because you didn’t stop it first. [import]uid: 44647 topic_id: 24050 reply_id: 97014[/import]

The advice given is spot on [import]uid: 84637 topic_id: 24050 reply_id: 97423[/import]