Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trilliwon/2d39f95f8fe0d5a943421290322111ad to your computer and use it in GitHub Desktop.
Save trilliwon/2d39f95f8fe0d5a943421290322111ad to your computer and use it in GitHub Desktop.
How to turn off the shutter sound when capture? AVFoundation
class PhotoCapture {
// here some stuff for capture image, such as capture session, configurations, photo output
// More detail : https://github.com/trilliwon/ArtCamera/blob/master/Camera/Controllers/PhotoCapture.swift
}
// MARK: - AVCapturePhotoCaptureDelegate
extension PhotoCapture: AVCapturePhotoCaptureDelegate {
func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) {
AudioServicesDisposeSystemSoundID(1108)
}
func photoOutput(_ output: AVCapturePhotoOutput, didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) {
AudioServicesDisposeSystemSoundID(1108)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment