开发者

Overriding iPhone shutter sound through SDK

开发者 https://www.devze.com 2023-03-21 10:11 出处:网络
In my iPhone app, I am using the UIImagePickerController with source type UIImagePickerControll开发者_C百科erSourceTypeCamera. When the user takes a picture, the phone plays the familiar camera shutte

In my iPhone app, I am using the UIImagePickerController with source type UIImagePickerControll开发者_C百科erSourceTypeCamera. 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).


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消