I have my app set up to record video from the camera using an AVCaptureSession, however, there is no audio with it. What do I need to do to record audio and then add it to the
Add below code between beginConfiguration()
and commitConfiguration()
// Add audio device to the recording
let audioDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio)
do {
let audioInput = try AVCaptureDeviceInput(device: audioDevice)
self.captureSession.addInput(audioInput)
} catch {
print("Unable to add audio device to the recording.")
}