iOs7下,使用AVAudioRecorder录音的时候,会在顶部出现一个红框,或者红框一闪而过,这时候需要设置AVAudioSession,如下代码:
AVAudioSession * session = [AVAudioSession sharedInstance]; NSError * sessionError = nil; [session setCategory:AVAudioSessionCategoryPlayAndRecord error: & sessionError]; if (session == nil) { NSLog( @" Error creating session:%@ " ,[sessionError description]); } else { [session setActive:YES error:nil]; }