开发者

AudioQueueStart() method can not play music in ios4 background

开发者 https://www.devze.com 2023-01-05 13:15 出处:网络
In the iphone 3.x platform, I use AudioQueueStart method to play music, but 开发者_运维百科on ios4 platform, once the program into the background,then no sound, but I notice that the app is still runn

In the iphone 3.x platform, I use AudioQueueStart method to play music, but 开发者_运维百科on ios4 platform, once the program into the background,then no sound, but I notice that the app is still running in background, I've added into the info.list UIBackgroundModes/Audio and applicationDidEnterBackground methods


One thing to check is that the AudioSession is active first.

In my case, I had previously set the session to inactive between song changes before starting a new song:

AudioSessionSetActive(false);

Once I removed this AudioQueueStart works just fine from the background.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号