i am developing a voice recording application. recording and playing running fine. Problem occurs when I minimize the app and open it again, recording and playing both stops. I think its related to AVAudioSession. The code for AVAudioSession i am using is:
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];
UInt32 doChangeDefault = 1;
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefault), &doChangeDefault);
Please help me. Thanks
I figured out the solution, I was using simple audio engine of cocos2d with it which created problems. simple audio engine called cdaudiomanager and it was also initializing avaudiosession which was the problem. So instead of using simple audio engine i used avaudioplayer and now everything is fine.