Preparing Custom Alert Sounds
For remote notifications in iOS, you can specify a custom sound that iOS plays when it presents a local or remote notification for an application. The sound files must be in the main bundle of the client application.Custom alert sounds are played by the iOS system-sound facility, so they must be in one of the following audio data formats:
- Linear PCM
- MA4 (IMA/ADPCM)
- µLaw
- aLaw
aiff, wav, or caf file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle.You may 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 application:afconvert /System/Library/Sounds/Submarine.aiff ~/Desktop/sub.caf -d ima4 -f caff -v |
Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.
No comments:
Post a Comment