diff --git a/Sources/CodeScanner/ScannerViewController.swift b/Sources/CodeScanner/ScannerViewController.swift index 9d3c5e0..3d5011f 100644 --- a/Sources/CodeScanner/ScannerViewController.swift +++ b/Sources/CodeScanner/ScannerViewController.swift @@ -491,7 +491,12 @@ extension CodeScannerView { @available(macCatalyst 14.0, *) extension CodeScannerView.ScannerViewController: AVCapturePhotoCaptureDelegate { - public func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) { + + public func photoOutput( + _ output: AVCapturePhotoOutput, + didFinishProcessingPhoto photo: AVCapturePhoto, + error: Error? + ) { isCapturing = false guard let imageData = photo.fileDataRepresentation() else { print("Error while generating image from photo capture data."); @@ -502,5 +507,20 @@ extension CodeScannerView.ScannerViewController: AVCapturePhotoCaptureDelegate { return } handler?(qrImage) - } + } + + public func photoOutput( + _ output: AVCapturePhotoOutput, + willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings + ) { + AudioServicesDisposeSystemSoundID(1108) + } + + public func photoOutput( + _ output: AVCapturePhotoOutput, + didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings + ) { + AudioServicesDisposeSystemSoundID(1108) + } + }