title: iOS - Add a custom alert sound
body: <p>I would like to add a custom alert sound to my iOS app. I have been trying to add it to my Xcode project but doesn't seem to work. I get the default alert sound instead of my custom alert sound.</p>
  
  <p>Pardon my ignorance I know very little about sound file formats. I am confused if I am using the correct format.</p>
  
  <p>Apple documentation states that I need to use one of the 4 formats (Linear PCM, MA4(IMA/ADPCM), µLaw, aLaw). </p>
  
  <p><strong>What I have done</strong></p>
  
  <ul>
  <li>I have a file that has the extension .m4a (quick time)</li>
  <li><p>I also tried using the afconvert tool to convert it</p>
  
  <p><strong>afconvert test.m4a test.caf -d ima4 -f caff -v</strong></p></li>
  <li><p>The duration of the sound file is well below 30 seconds</p></li>
  <li>I have added the file on to my Xcode project by copying it and saving it in the location where my other source code files exist</li>
  </ul>
  
  <p>When the notification is sent I get the default alert sound and not my custom alert sound.</p>
  
  <p>I have tried the below mentioned 2 lines of code and doesn't seem to work, I get a default sound instead</p>
  
  <pre><code>UILocalNotification *localNotif = [[UILocalNotification alloc] init];
  localNotif.soundName = @"test.caf";
  
  //or .m4a file
  localNotif.soundName = @"test.m4a";
  </code></pre>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li>Is .m4a a supported file format (is MA4 and .m4a the same ?)</li>
  <li>How can I create an audio file in one of the supported formats. Does Garage band have an option where I can save it in one of the supported formats ?</li>
  <li>What am I missing ?</li>
  </ul>