如何使用 UILocationNotification 在显示警报时播放声音循环
当使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当 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).