//同时录音和播放
if(![[AVAudioSessionsharedInstance].categoryisEqualToString:AVAudioSessionCategoryPlayAndRecord] || !([AVAudioSessionsharedInstance].categoryOptions== (AVAudioSessionCategoryOptionDefaultToSpeaker|AVAudioSessionCategoryOptionMixWithOthers))) {
[[AVAudioSessionsharedInstance]setCategory:AVAudioSessionCategoryPlayAndRecordwithOptions:AVAudioSessionCategoryOptionDefaultToSpeaker|AVAudioSessionCategoryOptionMixWithOtherserror:nil];
}
[[AVAudioSessionsharedInstance]setActive:YESerror:nil];