获取soundName by soundID将其分配给UILocalNotification [英] Get the soundName by soundID to assign it to a UILocalNotification

查看:162
本文介绍了获取soundName by soundID将其分配给UILocalNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UILocalNotification ,我不想设置为使用默认音。我使用AudioToolbox.framework,我有一个 SystemSoundID 通过参考这个库: https://github.com/TUNER88/iOSSystemSoundsLibrary

I have a UILocalNotification, and I don't want to set it to use a default tone. I have used AudioToolbox.framework, and I have a SystemSoundID by referring to this library: https://github.com/TUNER88/iOSSystemSoundsLibrary.

UILocalNotification 需要声音名称。如何从 SystemSoundID

推荐答案

UILocalNotification类中的soundName参考提及


对于此属性,指定应用程序中
声音资源的文件名主包或
UILocalNotificationDefaultSoundName来请求默认系统
声音。

For this property, specify the filename (including extension) of a sound resource in the app’s main bundle or UILocalNotificationDefaultSoundName to request the default system sound.

声音使用 UILocalNotificationDefaultSoundName

此外,来自多媒体编程指南


注意:系统提供的警报声音和系统提供的用户界面
音效不可用

Note: System-supplied alert sounds and system-supplied user-interface sound effects are not available to your application.

因此,您无法使用在任何系统声音ID ://github.com/TUNER88/iOSSystemSoundsLibraryrel =nofollow> iOSSystemSoundsLibrary

So you cannot use any system sound id you find in iOSSystemSoundsLibrary for this.

如果你想要一个自定义的声音,必须提供您自己的。

If you want a custom sound, you'll have to provide your own.

这篇关于获取soundName by soundID将其分配给UILocalNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆