I am creating voice recording application...Its working fine when I start the application. after some time I face 2 problems..
1. It stops recording. I can listen my sound from mic to earphone.
2. In ipod When I plug out mic and plug it in again..I am unable to listen recorded sound...
I think there is some problem in routing....
please help me out..
I am using following Code...
if ( audioSession.inputIsAvailable) {
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err];
NSLog(@"connected");
}
else {
NSLog(@"Not connected");
UInt32 category = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
}