Kamis, 14 Maret 2019

How to disable camera microphone on AVCapture device input

I am setting a microphone on a AVCaptureSession and I am in need of a switch for the mic. How should I proceed with this? Do I really need to the captureSession?.removeInput(microphone), or is there an easies way?


let microphone = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeAudio)

do {
let micInput = try AVCaptureDeviceInput(device: microphone)
if captureSession.canAddInput(micInput) {
captureSession.addInput(micInput)
}
} catch {
print("Error setting device audio input: \(error)")
return false
}



from How to disable camera microphone on AVCapture device input

How to disable camera microphone on AVCapture device input Rating: 4.5 Diposkan Oleh: Admin

0 komentar:

Posting Komentar

Popular Posts