UILocalNotification 或 EventKIt
有没有办法根据日期事件触发某种任务。我的问题是我想在特定日期播放声音(警报),它通过使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UILocalNotification
指出
soundName
属性最多只能播放 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 thesoundName
property will play for a maximum of 30 seconds only.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.
您可以使用
UILocalNotification
的soundName
属性安排自定义声音,但它不能是无限的。您可以使用repeatInterval
属性再次播放警报,使其看起来无限......You can schedule a custom sound using the
soundName
property ofUILocalNotification
, but it can't be infinite. You could use therepeatInterval
property to play the alert again, making it seem infinite...