Hide Red Recording Status Bar in iOS App When Not Recording

Hide Red Recording Status Bar In iOS App When Not Recording

Resolved, see edit 2

The bar will never disappear as long as the mic is in use, recording or not. it's a security measure to allow the user to know that an app is listening to the microphone, not to show that the phone is recording.

The only way to get it gone is to remove the mic from the input receivers

I see that your mic isn't being removed, there has to be some bug.

Point is, you cannot hide the Red bar as long as the microphone is opened..

if you want to temporarily disable it, you can try this maybe ?

[audioController setInputEnabled:NO]

What are you trying to accomplish anyway? there might be a better way to handle things

Edit 1: Added other workarounds

I didn't know that setInputEnabled was readonly, sorry.

Well, another thing to try is to stop the controller completely, try this:

[audioController stop]

if not, try to release it if you're not using ARC, or simply

audioController = Nil;

Hope that fixes the issue. but I rather try to find out why it's not removing mic from the input receivers.. perhaps mic is Nil when you call [audioController removeInputReceiver:mic] ??

Edit 2:Added solution

The problem arises when you initialize with inputEnabled set to YES, since it's readOnly, you can't disable the input, the only way is to actually release audioController.
if you're using ARC, just set it to Nil, if not, just [audioController release]

Hide red bar while recording in background

Do you think there is anyway to hide it while recording in background

Not "while recording in background". The user needs to know that this is happening.

You can eliminate the red bar — by changing your category and not recording in the background.

But you cannot record in the background without showing the red bar while you are in the background.

iOS when finished recording, turn off red status bar for AV Audio Recorder

Turns out I was missing just a few lines of code... here they are:

- (void)stopRecording {
[self.recorder pause];
[self.recorder stop];
self.recorder = nil;

[self.audioSession setActive:NO error:nil];
[self.audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
self.audioSession = nil;
}


Related Topics



Leave a reply



Submit