I am using Apple's RosyWriter
sample to record video and audio. Now I need to record audio using Bluetooth headset but it is not working for me. I am doing the below work for this
captureSession = [[AVCaptureSession alloc] init];
/*
* Create audio connection
*/
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")){
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];
captureSession.usesApplicationAudioSession = true;
captureSession.automaticallyConfiguresApplicationAudioSession = true;
}
AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];
// AVCaptureDeviceInput *audioIn = [[AVCaptureDeviceInput alloc] initWithDevice:[self audioDevice] error:nil];
AVCaptureDeviceInput *audioIn = [[AVCaptureDeviceInput alloc] initWithDevice:audioDevice error:nil];
if ([captureSession canAddInput:audioIn])
[captureSession addInput:audioIn];
I have also followed this question