I\'m using UILocalNotification in an application.
In the application there are two sounds which are played conditionally- I have applied proper conditio
I ran into the same issue, I had to do the following steps:
Convert the file from mp3 or wav to caf. As stated in other answers you can convert wav, aif and mp3 files in terminal using the command:
afconvert -f caff -d LEI16@44100 -c 1 in.mp3 out.caf
You can also export with Quicktime 7 as .aif with the following settings Linear PCM Rate 44.100 Linear PCM sample size 16 these aif files seem to be supported.
Make sure you files are less than 30 seconds, i.e 29 seconds or less.
Add you files to the root of your bundle, you can drag drop into Xcode or right click "add files to (projectname)"
Note you must select the following options:
a)Destination Copy items if needed
b)Add to targets (your build name(s))
4)Reference the file by its name including the extension e.g
notif.soundName = @"sound.caf";
Make sure you delete the app from the device / simulator between tests or you will not see the results of your changes.
If your still having problems, check the sound file file is in the root of the project. Check the Sound file "Target Membership" is selected in the show file inspector.