iOS Background audio recording

别来无恙 提交于 2019-12-04 06:04:54

From Apple Documentation

An app that plays or records audio continuously (even while the app is running in the background) can register to perform those tasks in the background. You enable audio support from the Background modes section of the Capabilities tab in your Xcode project. (You can also enable this support by including the UIBackgroundModes key with the audio value in your app’s Info.plist file.) Apps that play audio content in the background must play audible content and not silence.

Typical examples of background audio apps include:

Music player apps Audio recording apps Apps that support audio or video playback over AirPlay VoIP apps

For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:

  • Apps that record audio content while in the background

EDIT:

Also regarding your "Bluetooth device":

Check out the documentation for ExternalAccessory .

Be aware that you need to apply and get approved for a special developer program in order to be able to create external accessories.

Helpful tips::

It turns out that Apple's SpeakHere sample code with some modifications will start recording audio in the background if you just add the audio multitasking flag to information. You might look https://github.com/benvium/SpeakHere for an updated version of SpeakHere since Apple hasn't updated it in awhile.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!