如何让 iPhone 相机的快门声静音?
我可以通过调用 [UIImagePickerController takePicture:] 以编程方式使用 iPhone 拍摄照片,但当我这样做时,iPhone 会播放快门点击的响亮录音。当我在谷歌上搜索如何关闭点击声时,我找到了重命名 iPhone 播放的声音文件的建议。在我看来,我的应用程序这样做会导致它因访问系统框架而被应用程序商店拒绝。有没有一种编程方法可以关闭该声音?我的应用程序的性质要求相机保持安静。
I can snap a picture with the iPhone programmatically by calling [UIImagePickerController takePicture:], but when I do the iPhone plays a loud recording of a shutter click. When I google for how to turn off the click, I find advice to rename the sound file that the iPhone plays. It seems to me for my app to do that would lead to it being rejected from the App store for accessing system frameworks. Is there a programmatic way to shut off that sound? The nature of my app demands that the camera be silent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我假设您已经解决了这个问题,但您的应用程序应该在 Appstore 验证中失败,因为它不符合 iOS 开发许可协议。见下文:
I assume you have solved it since but your app supposed to fail on the Appstore validation as it doesn't comply with iOS Dev License agreement. See below:
不确定你是否愿意这样做......
发出声音是为了让某人知道正在拍照。这个想法是为了确保公众,特别是儿童的隐私和安全,”日本已经对其爱拍照的公民提出了这一要求。
日本和韩国已经制定了法律,要求在拍照时发出这种声音。
http://abcnews.go.com/Technology/story?id=6750825&page=1
摘录:
“塞根指出,在日本和韩国,为了回应越来越多的“裙底”报道,政府已经通过了类似于国王提议的法律。”
Not sure if you would want to do it...
The sound is there to let someone know a photo is being taken. The idea is to ensure privacy and safety of the public, especially children," something that Japan has already required of their snap-happy citizens
Japan and Korea already have laws that require this sound when taking pictures.
http://abcnews.go.com/Technology/story?id=6750825&page=1
excerpt:
"In Japan and Korea, Segan pointed out, in response to mounting reports of "underskirting," governments have passed laws similar to the one King proposes."
重命名声音文件不会使用“私有 API”;在沙箱内这是不可能的(假设你没有以某种方式突破沙箱)。
但是,在 4.0+ 上,您可以使用 AVCapture 来代替拍照。我不确定 AVCaptureStillImageOutput 是否播放快门声音;解决方法是使用视频帧。
我想知道你所说的“我的应用程序的性质”是什么意思。如果您正在尝试进行某种实时图像处理,那么视频帧首先是一个更好的方法。如果您尝试在用户许可的情况下安静地拍照,那么用户无论如何都应该能够使快门声音静音。如果您在未经用户许可的情况下尝试拍照,则可能违反了与 Apple 达成的某些协议。
Renaming the sound file wouldn't be using a "private API"; it's simply not possible from within the sandbox (assuming you haven't broken out of the sandbox somehow).
However, on 4.0+, you can use AVCapture to take pictures instead. I'm not sure if AVCaptureStillImageOutput plays a shutter sound; a workaround is to use video frames.
I have to wonder what you mean by "the nature of my app" though. If you're trying to do some sort of live image processing, then video frames are a much better way to go in the first place. If you're trying to take pictures silently with the user's permission, then the user should be able to silence the shutter sound anyway. If you're trying to take pictures without the user's permission, you're probably violating some agreement with Apple.
无论如何,我可以通过使用 AVCaptureStillImageOutput 在 AVCapture 框架的 snapStillImage 方法中使用此代码来使其工作。它在 iOS 8.3 iPhone 5 上完美运行。我还确认,如果您使用此功能,Apple 不会拒绝您的应用程序:
Swift 4:
For what it's worth, I was able to get this to work by using this code in the snapStillImage method of AVCapture framework using AVCaptureStillImageOutput. It works perfectly for me on iOS 8.3 iPhone 5. I have also confirmed that Apple won't reject your app if you use this:
Swift 4: