Overriding iPhone shutter sound through SDK

2019-01-27 03:03发布

In my iPhone app, I am using the UIImagePickerController with source type UIImagePickerControllerSourceTypeCamera. When the user takes a picture, the phone plays the familiar camera shutter sound. How can I replace this with my own custom sound? I know it's possible because I've seen other apps from the App Store do it (e.g. Red Laser).

2条回答
疯言疯语
2楼-- · 2019-01-27 03:19

I am quite certain it's not possible. AFAIK, Red Laser doesn't actually take a "normal" picture but uses UIGetScreenImage() (undocumented but nevertheless allowed for App Store apps) to make a screenshot of the live video feed. Since the OS does not play sound on this occasion, they are free to play their own sound.

Edit for clarification: As of OS 3.1, you are free to substitute the standard camera interface with your own controls. So you could place your own shutter button on the screen and play your own sound when the user taps it, but AFAIK there is now way to get rid of the OS's standard shutter sound.

查看更多
Root(大扎)
3楼-- · 2019-01-27 03:22

AFAIK the standard camera shutter sound cannot be changed via SDK.

This answer supports that. You can replace your own sound by switching sound files, but not in an app.

Some answers such as this one suggest using AVCapture, but this method takes video screenshots, which reduces the image quality. I

t appears that you can't change the shutter sound because you could make it a silent sound, and capturing images covertly is against the App Store policy. See this answer.

TLDR:

The only way to change the shutter sound is to use a video screen grab.

查看更多
登录 后发表回答