Monday, January 24, 2011

[How to] Put Custom Ringtone and SMS Notification into your iPhone

Following up on the earlier iPhone hacks is customizing the most common audio: ringtone and SMS notification. Apple has locked down custom ringtones and profit from them. The biggest problem is, their selection is scarce and sucks. Here’s a simple guide on how to upload the Ringtones:
  1. Choose an MP3 file and trim it to 30 seconds or less – I use Audacity (download link) to do it
  2. Import that MP3 into iTunes
  3. Goto iTunes -> Preferences (for Mac) or Edit -> Preferences (for PC)
  4. Navigate to Advanced -> Importing tab and set the “Import Using:” to AAC
  5. Find the trimmed MP3 file inside iTunes, right click and choose “Convert Selection to AAC”
  6. Right click the AAC version of the file and choose “Get Info”
  7. Note the path to the file as indicated by the “Where” section under the “Summary” tab
  8. Navigate to the location of the file and copy it to desktop
  9. Change the extension of the copied file to “.m4r”
  10. Open the files in iTunes and it should be automatically inserted under Ringtones category, which then can be transferred to iPhone
NOTE: I have tried to use “SoundConverter” and set the file type to be m4a. This actually doesn’t work. When I did it that way, the file will be uploaded but won’t be able to be played. It might have something to do with the file size generated by “SoundConverter” being too large.
SMS Notification is slightly more complicated than the Ringtones counterpart. SMS notification actually can’t be added, only modified. I also recommend shorter file for SMS notification. Here are the steps I take:
  1. Trim MP3 files using Audacity (usually SMS notification should be shorter, roughly 3-4 seconds should be good)
  2. Import the MP3 file to iTunes
  3. Change the iTunes import to AIFF (Follow the ringtones guide to change importing mode in iTunes)
  4. Find the AIFF file and copy to desktop
  5. Change the extension to “.caf”
  6. SFTP to the iPhone using Cyberduck (Mac) or WinSCP (Windows) or any other SFTP software
  7. Navigate to the following directory: “/System/Library/Audio/UISounds”
  8. Change one of the “sms-received.caf” file to “sms-received_.caf” where is an integer from 1 to 6 that is least preferrable
    For example: Rename “sms-received6.caf” to “sms-received_6.caf” to replace the Electronic with custom sound
      File name mapping to notification name:
      sms-received1.caf -> Tri-tone
      sms-received2.caf -> Chime.caf
      sms-received3.caf -> Glass
      sms-received4.caf -> Horn
      sms-received5.caf -> Bell
      sms-received6.caf -> Electronic
  9. Upload the file on the desktop using the old name of that was changed
    For example: if “sms-received_6.caf” is changed to “sms-received_6.caf”, upload the file using the name “sms-received6.caf”
  10. Choose in iPhone the replaced tone
    For example: if you replaced sms-received6.caf, then you should choose Electronic
UPDATE: Ringtone should be set to 30 seconds. Another way to trim the music is to use iTunes’ ‘start time’ & ‘stop time’ field. This field is accessible by right clicking the song then choosing Get Info -> Options. After performing that, you export the file as AAC then rename it.
UPDATE: As one commenter mentioned, the SMS Notification hack only works on jailbroken iPhone