iphone - 为本地通知选择自定义声音

标签 iphone objective-c ios ipad notifications

如何更改本地通知播放的声音?我使用下面的代码来播放默认声音:

notif.soundName = UILocalNotificationDefaultSoundName;

所以,我在下面尝试了这个,但没有用。我应该怎么办?感谢您的帮助!

notif.soundName = @"sound.caf";

最佳答案

您可以使用以下方法从 wav 和 mp3 转换:

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

关于iphone - 为本地通知选择自定义声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7170475/

相关文章:

ios - Alpha 没有改变 UINavigationBar 的 barTintColor

ios - swift : Hide button in subview

iphone - 从相机捕获图像后,应用程序在后台时收到通知

iphone - 在 Objective C 中构建加密 key 存储库?

ios - 在ios中将两个数组合并为一个

html - 粗体 `<b>` 标签和斜体 `<i>` 标签不适用于自定义字体系列

ios - Cordova 5 构建命令正在删除 iOS 设备方向设置

iphone - 我无法在 iPhone 上创建联系人群组,该如何解决?

iphone - Cocoa Touch 中的 MVC : How do the view and the model interact?

ios - 快速将 UIImage 转换为 base64 字符串