Skip to content

Commit

Permalink
Merge pull request #100 from twostraws/fix/shutter-noises
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Fallet authored Feb 28, 2023
2 parents 88a6132 + d016ea4 commit d8f10d9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Sources/CodeScanner/ScannerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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)
}

}

0 comments on commit d8f10d9

Please sign in to comment.