如何使用 UILocationNotification 在显示警报时播放声音循环

发布于 2024-09-25 04:27:09 字数 80 浏览 3 评论 0原文

当使用 UILocationNotification 显示警报时,声音仅播放一次。当警报在后台显示(如 Clock.app)时,如何播放声音循环。

Sound only played once when an alert is displayed using UILocationNotification.How to play a sound loop when an alert is displayed in background like Clock.app.

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

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

发布评论

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

评论(1

菩提树下叶撕阳。 2024-10-02 04:27:09

当 UILocationNotification 触发时,您无法播放声音循环。您将播放一种声音,并且该声音必须少于 30 秒,否则将播放系统声音。您可以使声音更长并在音频编辑器中自行重复,但这当然会增加声音的大小(iOS 尚不支持 .mp3 等压缩格式作为 UILocationNotification 中的声音文件)。

You can't play a sound loop when a UILocationNotification fires. You get one sound to play, and that sound must be less than 30 seconds, or the system sound will play instead. You can make the sound longer and repeat it yourself in audio editor, but this of course increases the size of the sound (and iOS doesn't yet support compressed formats like .mp3 as the sound file in UILocationNotification).

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