[Resolved] audio.stop - Error in build - CoronaSDK 2012.878 2012.08.11 - CASE # 16562

just so everyone does not submit a zillion bugs here is one I just submitted
CASE # 16562

Runtime error
Passed unexpected parameter type to audio.stop()
This worked flawlessly as of build 868 - but when I loaded 878 ( windows and mac - confirmed ) audio.stop Crashes

this is the line I get the error on -
if musicHandle ~= nil then audio.stop(musicHandle) end

I get this Error

stack traceback:
[C]: ?
[C]: in function ‘stop’
…corona-mobile\beta - projects\MyApp\SomeFile.LUA.lua:971: in function
'_list

Steps to reproduce

musicHandle = audio.loadStream(_G.audioDir … musicfile )
audio.play(musicHandle,{ loops=-1 })

–the music loads and plays fine. but when you do an audio.stop passing the handle - it crashes

if musicHandle ~= nil then audio.stop(musicHandle) end

the code works flawlessly in 868 - reinstalled - but 878 - bombs

Larry
DoubleSlashDesign.com

[import]uid: 11860 topic_id: 29813 reply_id: 329813[/import]

That is not a bug. You are not supposed to pass a handle to audio.stop(). audio.stop takes a channel (or an OpenAL source using the secret APIs). The documentation is quite explicit about this:
http://developer.coronalabs.com/reference/index/audiostop

The code has been changed to trigger a Lua error now so you don’t make this mistake. (You get a line number now to where the problem is.)

[import]uid: 7563 topic_id: 29813 reply_id: 119555[/import]

You are 100% correct, I do not know what I was thinking. But in all fairness it was working passing the the handle, I think that’s why I myself all screwed up.

I changed it to a channel and again it works - “FLAWLESS”

Thanks

Larry Meadows [import]uid: 11860 topic_id: 29813 reply_id: 119609[/import]

Yes, the behavior was a little unpredictable passing a handle. That’s why making it a hard Lua error was probably a good idea.
[import]uid: 7563 topic_id: 29813 reply_id: 119657[/import]

That is not a bug. You are not supposed to pass a handle to audio.stop(). audio.stop takes a channel (or an OpenAL source using the secret APIs). The documentation is quite explicit about this:
http://developer.coronalabs.com/reference/index/audiostop

The code has been changed to trigger a Lua error now so you don’t make this mistake. (You get a line number now to where the problem is.)

[import]uid: 7563 topic_id: 29813 reply_id: 119555[/import]

You are 100% correct, I do not know what I was thinking. But in all fairness it was working passing the the handle, I think that’s why I myself all screwed up.

I changed it to a channel and again it works - “FLAWLESS”

Thanks

Larry Meadows [import]uid: 11860 topic_id: 29813 reply_id: 119609[/import]

Yes, the behavior was a little unpredictable passing a handle. That’s why making it a hard Lua error was probably a good idea.
[import]uid: 7563 topic_id: 29813 reply_id: 119657[/import]