通过SDK覆盖iPhone快门声音

发布于 2024-08-21 14:20:56 字数 190 浏览 3 评论 0原文

在我的 iPhone 应用程序中,我使用源类型为 UIImagePickerControllerSourceTypeCamera 的 UIImagePickerController。当用户拍照时,手机会播放熟悉的相机快门声音。如何用我自己的自定义声音替换它?我知道这是可能的,因为我已经看到 App Store 中的其他应用程序这样做了(例如 Red Laser)。

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).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云淡风轻 2024-08-28 14:20:56

我非常确定这是不可能的。 AFAIK,Red Laser 实际上并没有拍摄“正常”照片,而是使用 UIGetScreenImage()(未记录,但 App Store 应用程序允许)来制作实时视频源的屏幕截图。由于操作系统此时不播放声音,因此它们可以自由播放自己的声音。

编辑澄清:从 OS 3.1 开始,您可以自由地用自己的控件替换标准相机界面。因此,您可以在屏幕上放置自己的快门按钮,并在用户点击它时播放自己的声音,但据我所知,现在有办法摆脱操作系统的标准快门声音。

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.

仙女山的月亮 2024-08-28 14:20:56

AFAIK 标准相机快门声音无法通过 SDK 更改。

这个答案支持这一点。您可以通过切换声音文件来替换自己的声音,但不在应用程序中。

一些诸如此类的答案建议使用 AVCapture,但该方法采用视频截图,降低了图像质量。您

似乎无法更改快门声音,因为您可以将其设为无声,并且秘密拍摄图像违反了应用商店政策。 请参阅此答案。

TLDR:

更改快门声音的唯一方法是使用视频屏幕抓取。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文