AudioQueueStart()方法无法在ios4后台播放音乐

发布于 2024-09-07 19:00:44 字数 165 浏览 2 评论 0原文

在iphone 3.x平台上,我使用AudioQueueStart方法来播放音乐,但是在ios4平台上,一旦程序进入后台,就没有声音,但我注意到该应用程序仍在后台运行,我已经添加到info.list UIBackgroundModes/Audio 和 applicationDidEnterBackground 方法

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月打碎记忆 2024-09-14 19:00:44

要检查的一件事是 AudioSession 首先是否处于活动状态。

就我而言,在开始一首新歌曲之前,我之前已将会话设置为在歌曲更改之间处于非活动状态:

AudioSessionSetActive(false);

一旦我删除此 AudioQueueStart 从后台就可以正常工作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文