Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS multitasking for an Audio Recording application

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 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.

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?

like image 203
dineth Avatar asked Oct 03 '10 01:10

dineth


People also ask

Does IOS support multitasking?

On iPhone, multitasking lets people use FaceTime or watch a video in Picture in Picture while they also use a different app. The app switcher displays all currently open apps. A current FaceTime call can continue while people use another app.

How does application multitasking work on IOS?

Open an app. Slide one finger up from the bottom edge of the screen until the Dock appears, then release. Touch and hold a second app in the Dock, then immediately drag it up out of the Dock. If you drag the app to the left or right edge of the screen, it appears in Split View with the current app.


1 Answers

You can. Skype does this.

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).

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).
like image 192
tc. Avatar answered Sep 21 '22 03:09

tc.