iOS multitasking for an Audio Recording application

前端 未结 3 1067
别那么骄傲
别那么骄傲 2020-12-01 00:42

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

The an

3条回答
  •  一个人的身影
    2020-12-01 00:45

    You can. Skype does this.

    You presumably need to set UIBackgroundModesaudio 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).

    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:

    • Set both "voip" and "audio".
    • Play silence (this might be easiest to do with the Audio Queue API).

提交回复
热议问题