多任务 iphone sdk-uibackgroundmodes 无法处理音频?

发布于 2024-11-09 20:56:51 字数 311 浏览 0 评论 0原文

嘿, 我正在开发一个流式传输互联网 mp3 音频的应用程序。它是一个无线电应用程序,现在我想添加多任务功能,但不幸的是它不起作用。一旦应用程序进入后台,音频就会关闭。 mp3 流媒体正在使用 audiotoolbox。我怎样才能同时处理多项任务?我已经尝试了 uibackgroundmodes 通过将其添加到 plist 中(必须通过进入文本文件来手动添加它,因为它没有显示在下拉菜单中可能是这可能的原因,但我不知道如果出现这种情况该怎么办就是这个原因)。所以我的问题很明确,为了使我的应用程序实现多任务,我还需要做什么?我有什么遗漏的吗(我很确定,但不确定是什么)。任何代码将不胜感激 谢谢, TC

Hey,
I am working on an application that streams mp3 audio of the internet. it is a radio application and now I would like to add multitasking functionality but unfortunately it isn't working. the audio shuts off as soon as the application goes into background. the mp3 streamer is using audiotoolbox. How can I multitask? I have tried the uibackgroundmodes by adding it in plist (had to add it manually by going into text file because it wasn't showing up in the drop down menu may be this could the reason why but I am not sure what to do if this is the reason). So my question is clear is there anything else I have to do in order to make my application multitask? is there anything I am missin (well sure I am but not sure what). Any code would be appreciated
thanks,
TC

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

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

发布评论

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

评论(1

德意的啸 2024-11-16 20:56:51

如果您已正确编辑 Info.plist,以允许背景音频(请参阅 post),那么如果音频开始,它应该在应用程序进入后台时播放。引用自 Apple 文档

只要正在播放音频或视频内容,应用程序就会继续在后台运行以支持该内容。但是,如果应用程序停止播放该音频或视频,系统会将其挂起。同样,如果应用程序在其 Info.plist 文件中未包含适当的密钥,则应用程序在进入后台后将立即暂停。

If you've correctly edited the Info.plist, to allow background audio (see post), then if audio started it should play when app enters background. Quote from Apple documentation:

As long as it is playing audio or video content, the application continues to run in the background to support that content. However, if the application stops playing that audio or video, the system suspends it. Similarly, if the application does not include the appropriate key in its Info.plist file, the application becomes eligible for suspension immediately upon entering the background.

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