Console error when calling audio.stop?

I keep getting an error in the console which states:

  • Warning: Passed explicit nil to audio.stop. This is now treated as a no-op. To stop all channels, call audio.stop() with no parameters.

I create and load my audio like so:

bossMusic = audio.loadSound( "Sounds/Level Choose.mp3" ) bossMusic = audio.play( bossMusic ) audio.setVolume( 0.60, { bossMusic } )

Then when I need to change scenes I’m trying to remove the audio like so:

audio.stop ( bossMusic ) audio.dispose( bossMusic ) bossMusic = nil

However I keep getting the same error I mentioned in the console, I can’t really understand what I’m doing wrong? [import]uid: 107915 topic_id: 35341 reply_id: 335341[/import]

You have to call audio.stop on a channel not the variable.

audio.play(myAudio,{channel=1,onComplete=disposemyAudio})
audio.stop(1) [import]uid: 100901 topic_id: 35341 reply_id: 140465[/import]

Is that a definite because on in my home scene I have:
audio.dispose( homeScreenMusic )
homeScreenMusic = nil

And it seems to dispose without issues and with no warning in the console. [import]uid: 107915 topic_id: 35341 reply_id: 140466[/import]

Yes it is.
http://docs.coronalabs.com/api/library/audio/stop.html
[import]uid: 100901 topic_id: 35341 reply_id: 140467[/import]

Dispose uses the handle to the sound, audio.stop() uses the channel #. They are different variables. [import]uid: 199310 topic_id: 35341 reply_id: 140478[/import]

Thanks both for your replies, channels it is then! [import]uid: 107915 topic_id: 35341 reply_id: 140492[/import]

You have to call audio.stop on a channel not the variable.

audio.play(myAudio,{channel=1,onComplete=disposemyAudio})
audio.stop(1) [import]uid: 100901 topic_id: 35341 reply_id: 140465[/import]

Is that a definite because on in my home scene I have:
audio.dispose( homeScreenMusic )
homeScreenMusic = nil

And it seems to dispose without issues and with no warning in the console. [import]uid: 107915 topic_id: 35341 reply_id: 140466[/import]

Yes it is.
http://docs.coronalabs.com/api/library/audio/stop.html
[import]uid: 100901 topic_id: 35341 reply_id: 140467[/import]

Dispose uses the handle to the sound, audio.stop() uses the channel #. They are different variables. [import]uid: 199310 topic_id: 35341 reply_id: 140478[/import]

Thanks both for your replies, channels it is then! [import]uid: 107915 topic_id: 35341 reply_id: 140492[/import]