Avaneesh Singh
Avaneesh Singh

Reputation: 11

When AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient is occured AVCaptureSession is not recording video in ios

During AVCaptureSession is running, when a phone call is occurred I get the interruption with reason AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient and I called [captureSession beginConfiguration] and remove AVCaptureDeviceInput of AVMediaTypeAudio with lastly [captureSession commitConfiguration] and [captureSession startRunning] but I am unable to record video with output as AVCaptureMovieFileOutput. Pls help. Thanks

Upvotes: 1

Views: 165

Answers (1)

zXielony
zXielony

Reputation: 11

I had similar problem while using GPUImage. Following code did the work: First remove audio outputs and inputs:

[_captureSession beginConfiguration];
[_captureSession removeInput:audioInput];
[_captureSession removeOutput:audioOutput];
audioInput = nil;
audioOutput = nil;
_microphone = nil;
[_captureSession commitConfiguration];

Then restart session

[_captureSession startRunning];

I think the part you are missing is removing output.

Upvotes: 1

Related Questions