BGM stops playing on resume after suspend

Hello!

So I have this background music that is looped. When I press the lock button on top of the phone for the first time and then unlock the phone after a few seconds, the BGM resumes normally (the music abruptly stops when I do this). But when I do it a second time (this time, the music fades out) the music does not continue anymore.

Doing it again makes the music resume again. I am trying to make sure that the music keeps playing. Been stuck with this for a while already.

What can be wrong with this?

Here’s my code:

[lua]local function onSystemEvent( event )
if event.type == “applicationStart” then
if (model == “iPad” or model == “iPhone” or model == “iPod touch”) then
gameNetwork.init( “gamecenter”, initCallback )
end
elseif event.type == “applicationExit” then
audio.pause( backgroundMusicChannel )
elseif event.type == “applicationSuspend” then
audio.pause( backgroundMusicChannel )
elseif event.type == “applicationResume” then
audio.resume( backgroundMusicChannel )
end
end

Runtime:addEventListener( “system”, onSystemEvent )[/lua]

backgroundMusicChannel is a global variable, by the way.

Regards,

John [import]uid: 186198 topic_id: 33842 reply_id: 333842[/import]