   }
   
   /**
+   Create `audioInput` and add it to `captureSession`.
+   - Throws: `CaptureManagerError.InvalidCaptureInput` if the input cannot be added to `captureSession`.
+  */
+  fileprivate func addAudioInput() throws {
+    let audioDevice = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeAudio)
+    audioInput = try AVCaptureDeviceInput(device: audioDevice)
+    
+    if (!captureSession.canAddInput(audioInput)) {
+      throw CaptureManagerError.invalidCaptureInput
+    }
+    
+    captureSession.addInput(audioInput)
+  }
+  
+  /**
    Create `stillImageoutput` and add it to `captureSession`.
    - Throws: `CaptureManagerError.InvalidCaptureOutput` if the output cannot be added to `captureSession`.
    */

    case .video:
      try addVideoInput()
    case .audio:
      //TODO: Add audio input.
      break
    }
  }

  fileprivate func removeInput(_ input: CaptureSessionInput) {
    switch input {
    case .video:
      if let videoInput = videoInput {
        captureSession.removeInput(videoInput)
      }
    case .audio:
      if let audioInput = audioInput {
        captureSession.removeInput(audioInput)
      }
      break
    }
  }
