twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.03k stars 295 forks source link

Multiple Camera shutter noises with the 2.3.0 release #99

Closed Furthermoore closed 1 year ago

Furthermoore commented 1 year ago

I recently updated my CodeScanner lib from 1.1.0 to 2.3.0 and a QA engineer noticed several repetitive camera shutter sounds when scanning a QR code. I couldn't reproduce it on my end; He has an iPhone 14 Pro and I have an iPhone SE.

Anyway, I went looking for ways to silence this camera noise when using AVFoundation and came across a few posts on the interwebs: https://enebin.medium.com/swiftui-how-to-turn-off-or-change-camera-shutter-sound-ecfa604394f0 and https://stackoverflow.com/questions/4401232/avfoundation-how-to-turn-off-the-shutter-sound-when-capturestillimageasynchrono

So I then went looking for usage of AVCapturePhotoCaptureDelegate api and noticed you added it in the 2.3.0 release of CodeScanner.

So I reverted our library back to CodeScanner 2.2.1 and then the issue went away on his iPhone 14 Pro.

I wish I could share more, but my codebase is private. Anyway, I just wanted to give a heads up as I'm wondering if anyone else has noticed this.

nathanfallet commented 1 year ago

@Furthermoore Can you try using branch fix/shutter-noises and tell me if it solves your problem?

Furthermoore commented 1 year ago

@NathanFallet yep, that solved it. Thanks!

nathanfallet commented 1 year ago

Perfect! I'm going to publish a release then.