iOS 替换通知声音

2017-07-04  本文已影响0人  RobinZhao

Preparing Custom Alert Sounds

Local and remote notifications can specify custom alert sounds to be played when the notification is delivered. You can package the audio data in an aiff, wav, or caf file. Because they are played by the system-sound facility, custom sounds must be in one of the following audio data formats:

Place custom sound files in your app bundle or in the Library/Sounds folder of your app’s container directory. Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.
You can use the afconvert tool to convert sounds. For example, to convert the 16-bit linear PCM system sound Submarine.aiff to IMA4 audio in a CAF file, use the following command in the Terminal app:

afconvert /System/Library/Sounds/Submarine.aiff ~/Desktop/sub.caf -d ima4 -f caff -v

For information on how to associate a sound file with a notification, see Adding a Sound to the Notification Content.

以上来自官方文档
声音素材地址Online-Audio-Converter
上一篇 下一篇

猜你喜欢

热点阅读