播放声音时不停止录制Avcapture
我有一个video录像,那么我有一个AVAudioPlayer,问题是,当声音,你停止注册video。
testAudioPlayer = [[AVAudioPlayer alloc] initWithData:sampleData error:&audioError]; [sampleData release]; if(audioError != nil) { NSLog(@"An audio error occurred: \"%@\"", audioError); } else { [testAudioPlayer setVolume:100]; [testAudioPlayer setNumberOfLoops: -1]; [testAudioPlayer play];``
提前致谢
解决scheme创buildAVaudiosession到viewdidload
NSError *setCategoryError = nil; [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setCategoryError]; if (setCategoryError) { NSLog(@"%@",[setCategoryError description]); } OSStatus propertySetError = 0; UInt32 allowMixing = true; propertySetError = AudioSessionSetProperty ( kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof (allowMixing), &allowMixing);