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

AVAudioSession: Show and hide red bar on Home screen

Nirmalsinh
1#
Nirmalsinh Published in 2018-01-09 17:03:31Z

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.302229 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO