Hide Recording Status Bar When Not Using Microphone

edited June 2013

I'm using the AEAudioController to access the microphone when the user presses record. At the beginning of the app, I setup the audio like this:

self.audioController = [[AEAudioController alloc] initWithAudioDescription:audioDescription inputEnabled:YES];

Later when they press record, I add a receiver:

[self.audioController addInputReceiver:inputMonitor];

The problem is that when they go into the background, the red "Recording" status bar shows - even when they're not recording. So then I tried setting the category when the mic isn't used:

self.audioController.audioSessionCategory = kAudioSessionCategory_MediaPlayback;

This logs:

TAAE: Setting audio session category to MediaPlayback
2013-06-01 21:55:16.606 SpeakY[6764:907] AEAudioController.m:1657: AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput) result 2003329396 77686174

But when I press the home button, the device shows the red "Recording" status bar at the top. Any idea how I can get this to hide when I'm in the background and not using the mic?


  • I have the same need. My solution is to stop audioController when my app goes into background and there is no receivers or channels associating with audioController, and re-create the audioController when my app becomes active and when I need a audioController. For your reference, here is the relevant code in my app.

    • (void)setPlayCount:(int)playCount
      _playCount = playCount;
      assert(_playCount >= 0);
      assert(_playCount <= 2);

      [self stopAudioControllerWhenDone];

    • (void)setRecordCount:(int)recordCount
      _recordCount = recordCount;
      assert(_recordCount >= 0);
      assert(_recordCount <= 2);

      [self stopAudioControllerWhenDone];

    • (void)applicationWillResignActive:(NSNotification *)notification
      self.applicationInBackground = YES;

      [self stopAudioControllerWhenDone];

    • (void)applicationDidBecomeActive:(NSNotification *)notification
      self.applicationInBackground = NO;

    • (void)stopAudioControllerWhenDone
      if (self.applicationInBackground &&
      (self.playCount == 0) &&
      (self.recordCount == 0)) {

      if (_audioController) {
          [_audioController stop];
          _audioController = nil;


    • (AEAudioController*)audioController
      if (!_audioController) {

      AudioStreamBasicDescription asbd = /* ... */;
      AEAudioController* tempAudioController = [[AEAudioController alloc] initWithAudioDescription:asbd
      NSError* error = nil;
      BOOL succeed = [tempAudioController start:&error];
      if (!succeed) {
          NSString* message = [NSString stringWithFormat:@"Couldn't initialize audio: %@", [error localizedDescription]];
          [[[UIAlertView alloc] initWithTitle:@"Error"
                            otherButtonTitles:@"OK", nil] show];
      } else {
          _audioController = tempAudioController;


      return _audioController;


  • Thanks Ian - I appreciate your help.

    In my app, the user may be listening to audio in the background so I need to keep the audioController around.

  • +1 - looking for this answer too.

  • edited June 2013

    Still not working. Can anyone help?

    I setup the following block of code to run every 2 seconds in my app.

    audioController.audioSessionCategory = kAudioSessionCategory_MediaPlayback;
    AVAudioSession *audioSession = [AVAudioSession sharedInstance];
    NSError* error = nil;
    [audioSession setActive:NO error: &error];
    NSLog(@"error: %@", error);
    [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];

    This logs:

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

    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.

Sign In or Register to comment.