I am trying to record video using AVFoundation. When I add video input only to the session, everything works fine but when I add an audio input to it, it stops recording the
I have figured it out. I needed category mixing. Following is the code that made it:
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);