用于音频录制应用程序的iOS多任务处理

编程入门 行业动态 更新时间:2024-10-23 04:45:44
本文介绍了用于音频录制应用程序的iOS多任务处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写一个记录音频的应用程序。我正在研究在录音时支持多任务的可行性(在后台)。

I am writing an application that records audio. I am looking into the feasibility of supporting multitasking while doing audio recordings (in the background).

答案似乎是 no 我到目前为止已阅读过,特别是因为该程序旨在释放切换时使用的所有系统资源。

The answer seems to be a no from what I've read so far, especially since the program is meant to release any system resources being used when switched out.

所以我想知道,是否有可能让当我的应用程序继续在后台捕获音频时,用户切换到iOS中的另一个应用程序?

So I am wondering, is it possible to let the user switch to another application in iOS while my application continues to capture audio in the background?

推荐答案

你可以。 Skype会这样做。

You can. Skype does this.

你可能需要设置< key> UIBackgroundModes< / key>< array>< string> audio< / Info.plist中的字符串>< / array> ,您需要确保音频会话处于活动状态/正在运行/切换应用之前的任何内容(假设您不会突然启动录制/播放音乐/当你的应用在后台播放时。)

You presumably need to set <key>UIBackgroundModes</key><array><string>audio</string></array> in Info.plist, and you need to make sure that the audio session is active/running/whatever before you switch apps (the assumption is that you won't suddenly start recording/playing music/whatever when your app is in the background).

文档说audio允许你在后台播放音频,但这可能也适用于录制音频。如果它不起作用,你可以尝试一些事情:

The docs say that "audio" lets you play audio in the background, but presumably this also applies to recording audio. If it doesn't work, there are a few things you could try:

  • 设置voip和audio。
  • 播放静音(这可能是最容易使用音频队列API)。

更多推荐

用于音频录制应用程序的iOS多任务处理

本文发布于:2023-11-27 03:12:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636333.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   音频   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!