title: Hide Red Recording Status Bar In iOS App When Not Recording
body: <p>I can't get the red "Recording" status bar to hide in my app when the app is in the background and not recording.</p>
  
  <p><img src="https://i.stack.imgur.com/h4Rk1.jpg" alt="enter image description here"></p>
  
  <p>I happen to be using <a href="http://theamazingaudioengine.com/" rel="noreferrer">The Amazing Audio Engine</a>, but I think this question could be tackled knowledge of that library. It gets setup like this:</p>
  
  <pre><code>audioController = [[AEAudioController alloc] initWithAudioDescription:desc inputEnabled:YES];
  audioController.audioSessionCategory = kAudioSessionCategory_MediaPlayback;
  </code></pre>
  
  <p>When the user wants to record, I turn on the mic like this:</p>
  
  <pre><code>[audioController addInputReceiver:mic];
  audioController.audioSessionCategory = kAudioSessionCategory_PlayAndRecord;
  </code></pre>
  
  <p>When the user wants to stop recording, I turn it off:</p>
  
  <pre><code>[audioController removeInputReceiver:mic];
  audioController.audioSessionCategory = kAudioSessionCategory_MediaPlayback;
  </code></pre>
  
  <p>The problem is, when the app isn't recording &amp; the user leaves the app, the red "Recording" status bar still shows up. I can't stop/dispose the audioController because the app may still be <em>playing</em> audio.</p>
  
  <p><strong>I don't want the red recording status bar to show if I'm not recording. Any ideas how to do this?</strong></p>
  
  <h2>Update</h2>
  
  <p>I setup the following block of code to run every 2 seconds in my app.</p>
  
  <pre><code>audioController.audioSessionCategory = kAudioSessionCategory_MediaPlayback;
  
  AVAudioSession *audioSession = [AVAudioSession sharedInstance];
  NSError* error = nil;
  [audioSession setActive:NO error: &amp;error];
  NSLog(@"error: %@", error);
  [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
  </code></pre>
  
  <p>This logs:</p>
  
  <pre><code>TAAE: Setting audio session category to MediaPlayback
  AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput)    result 2003329396 77686174 what
  Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)"
  </code></pre>
  
  <p>Obviously it fails to disable the mic because of something TAAE is holding on to. I have not added any inputs to the controller, so I don't know what it could be.</p>