Skip to content

Conversation

@hoonjoo-park
Copy link

Summary

This PR adds support for the shutterPhotoSound option on iOS devices. Previously, this option was only available on Android.

However, I thought that iOS users may also want to disable the shutter sound in certain contexts (e.g., silent environments or custom UX requirements). As part of this, I've implemented a silentCapture method on iOS.

The silent image capture flow follows this pipeline:

AVCaptureVideoDataOutput → imageBuffer →  cvPixelBuffer → CIImage → CGImage → UIImage → JPEG image Data.

The implementation also:

  • Uses motion manager data to determine the correct image orientation
  • Ensures thread safety by using main thread callbacks
  • Respects the shutterPhotoSound setting to enable silent photo capture

How did you test this change?

I thoroughly tested these changes on multiple iOS devices:

  • iPhone 16 Pro (Simulator)
  • iPhone 12 (Physical device)
  • iPhone 7 (Physical device)

Testing verified:

  • capture function works correctly with shutterPhotoSound both enabled and disabled
  • Proper image orientation is maintained in all device orientations
  • No regression in existing functionality

@hoonjoo-park
Copy link
Author

Hi @scarlac.

If this PR gets accepted, I’ll also update the comment for shutterPhotoSound in CameraProps.ts as well as the README accordingly.

@hoonjoo-park
Copy link
Author

Hi @lichstam !!
Would you mind reviewing this PR when you get a moment? Thanks in advance!

Copy link
Collaborator

@scarlac scarlac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but this PR has an excessive amount of code, just for the purpose of disabling sound. Simply because of that, I have to refuse the PR, unless you can find a way that involves much less code and which doesn't involve changing the photo capturing pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants