Home AVAudioSession: Show and hide red bar on Home screen
Reply: 0

AVAudioSession: Show and hide red bar on Home screen

user989 Published in July 23, 2018, 1:32 pm

I am recording audio and playing into the headphone. I am using AVAudioSession to recording and playing audio. Here is my code:

objSession = [AVAudioSession sharedInstance];
[objSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
[objSession setActive: YES error: nil];
[objSession setPreferredIOBufferDuration:0.003 error:nil];

My question is when I run this code it will start recording audio and it will show red bar when we move application to background. Now I want to stop AVAudionSession. When its stop, then there is no red bar on Home screen.

Here is code to stop audio:

[objSession setActive:NO error: nil];
objSession = nil;

But red bar on the home screen is not accurate and even audio recording is create an issue. So anyone can help to show and hide red bar and handle audio recording?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.315653 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO