title: How do I start a Record iOS audio session in the background?
body: <p>I'm trying to start a <code>kAudioSessionCategory_RecordAudio</code> after my app is woken up in the background but not forefront (like during a significant location change, I have seen other apps in the store do this so I know it is possible). However whenever I try to start the audio session like so</p>
  
  <p><code>CheckError(AudioQueueStart(queue,
                                 NULL),
                 "AudioQueueStart failed");
  </code></p>
  
  <p>I get this error:</p>
  
  <p><code>Error: AudioQueueStart failed (-12985)</code></p>
  
  <p>So I read up on that but only suggestion is setting the audio session to active <code>AudioSessionSetActive(YES)</code> but that also fails with a <code>'!cat'</code> error. Apparently you can try to toggle the active state of the audio session but that hasn't worked for me.</p>
  
  <p>I have the audio background mode plist flag set and starting an audio session while my app is forefront then switching to another app works (shows the red bar showing that it is recording). Its just starting the audio session while the app isn't forefront is the issue.</p>
  
  <p>Does anyone have a <strong>sample project</strong> I could look at demonstrating starting a recording audio session in the background? </p>
  
  <p>Note: I am looking for a solution that uses audio queues as I need the audio in buffers, not a file.</p>