UILocalNotification 或 EventKIt

发布于 2024-09-12 12:57:07 字数 128 浏览 1 评论 0原文

有没有办法根据日期事件触发某种任务。我的问题是我想在特定日期播放声音(警报),它通过使用 UILocalNotification 可以正常工作,但它会播放短声音,我想要播放无限的声音而不是。我怎样才能实现这个目标.. 等待您的早日回复。 谢谢

Is there a way to trigger some kind of task on the base of date event .My problem is that i want to play sound (alarm) on specific date it does work fine by using UILocalNotification, but it plays s short sound , and i want to play an infinite sound instead of .How can i achieve this goal ..
waiting for your early response.
Thanks

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

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

发布评论

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

评论(2

烟凡古楼 2024-09-19 12:57:07

UILocalNotification指出 soundName 属性最多只能播放 30 秒。

持续时间超过 30 秒的声音将被忽略,并改为播放默认声音。

添加自定义声音时,请确保声音格式正确(线性 PCM 或 IMA4)

从 wav 和 mp3 进行转换:

afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf

您可以使用以下命令 你想知道什么是 afcomvert ..它只是命令行程序
Caf 是容器格式。

有时模拟器不会播放自定义声音,但设备会播放。

The apple documentation of UILocalNotification states that the soundName property will play for a maximum of 30 seconds only.

Sounds that lasts longer than 30 seconds are ignored and the default sound is played instead.

While adding the custom sound make sure the sound is in the correct format (linear PCM or IMA4)

You can convert from wav and mp3 using:

afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf

In case if u were wondering what is afcomvert ..it's nothing but command line program
Caf is container format..

Sometimes emulator won't play the custom sound but device does.

哎呦我呸! 2024-09-19 12:57:07

您可以使用 UILocalNotificationsoundName 属性安排自定义声音,但它不能是无限的。您可以使用 repeatInterval 属性再次播放警报,使其看起来无限......

You can schedule a custom sound using the soundName property of UILocalNotification, but it can't be infinite. You could use the repeatInterval property to play the alert again, making it seem infinite...

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