audio.stop() issue

I just find after upgrade to daily build 919. All the audio.stop() become not working and prompt this message.

+++++++++++++++++++++++++++++++++++++++++++++++
main.lua:286: Passed unexpected parameter type to audio.stop()

+++++++++++++++++++++++++++++++++++++++++++++++

kc [import]uid: 94613 topic_id: 31342 reply_id: 331342[/import]

Try audio.stop({channel=NumChannel})
[import]uid: 69841 topic_id: 31342 reply_id: 125260[/import]

Hi there,
I copied this from the Release Notes from the most recent public build (894):

“Core: Audio fixes and enhancements. WARNING: Minor API changes to audio.stop/stopWithDelay(). Passing 0, negative numbers, or nil as a channel parameter will now act as a no-op instead of stopping playback on all channels. This is intended to avoid problems where playing a sound fails for some reason (e.g. already playing 32 sounds at the same time) and you don’t check the return value and try to stop the sound later which causes all sounds to stop which is not usually the intention. Now, to stop all channels, you should omit the channel parameter completely. Also fixed bugs in audio.stop() and audio.rewind() where it did not handle table parameters (e.g. channel, source, handle) correctly. Also fixed unexpected behavior in GetChannelFromSource and GetSourceFromChannel if you passed 0 or –1 and the engine would retrieve a free/available resource instead. It now returns –1 and 0 respectively.”

Does this address the issue you’re having or is it something else?

Brent [import]uid: 9747 topic_id: 31342 reply_id: 125410[/import]

Thanks, I’m using the following code to solve part of the problem. Now they can play and stop. But don’t know why after few round of back and forward to different state. There are many channel playing together. I still working on this and try to find the problem. I’m sure the following code is correct according the corona web site document info.

local bgsound = audio.loadStream(“bgsound1.mp3”)
local backgroundMusicChannel
audio.stop( backgroundMusicChannel )
backgroundMusicChannel = audio.play( bgsound, { channel=2, loops=-1, fadein=3000 } )

Hope I can solve the problem and share with you guys later.

kc [import]uid: 94613 topic_id: 31342 reply_id: 125447[/import]

Try audio.stop({channel=NumChannel})
[import]uid: 69841 topic_id: 31342 reply_id: 125260[/import]

Hi there,
I copied this from the Release Notes from the most recent public build (894):

“Core: Audio fixes and enhancements. WARNING: Minor API changes to audio.stop/stopWithDelay(). Passing 0, negative numbers, or nil as a channel parameter will now act as a no-op instead of stopping playback on all channels. This is intended to avoid problems where playing a sound fails for some reason (e.g. already playing 32 sounds at the same time) and you don’t check the return value and try to stop the sound later which causes all sounds to stop which is not usually the intention. Now, to stop all channels, you should omit the channel parameter completely. Also fixed bugs in audio.stop() and audio.rewind() where it did not handle table parameters (e.g. channel, source, handle) correctly. Also fixed unexpected behavior in GetChannelFromSource and GetSourceFromChannel if you passed 0 or –1 and the engine would retrieve a free/available resource instead. It now returns –1 and 0 respectively.”

Does this address the issue you’re having or is it something else?

Brent [import]uid: 9747 topic_id: 31342 reply_id: 125410[/import]

Thanks, I’m using the following code to solve part of the problem. Now they can play and stop. But don’t know why after few round of back and forward to different state. There are many channel playing together. I still working on this and try to find the problem. I’m sure the following code is correct according the corona web site document info.

local bgsound = audio.loadStream(“bgsound1.mp3”)
local backgroundMusicChannel
audio.stop( backgroundMusicChannel )
backgroundMusicChannel = audio.play( bgsound, { channel=2, loops=-1, fadein=3000 } )

Hope I can solve the problem and share with you guys later.

kc [import]uid: 94613 topic_id: 31342 reply_id: 125447[/import]