X

Convert audio to ringtones using OS X Terminal

If you want to use an audio file as a ringtone in iOS, you can use Terminal and iTunes to convert and import tones to your device.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
2 min read

Have you encountered a sound bite, or perhaps a full song, that you would like to use as an alert or ringtone on your iPhone? If so, then you can do so using a simple utility available in the OS X Terminal to convert into a tone for your iOS device.

The utility is called "afconvert," which stands for "Audio File Convert" and is a tool that Apple has included in OS X since 2003. As its name suggests, this tool allows you to specify one audio file and convert it to another format, managing bitrates and quality settings, extract channels, and perform a number of other manipulations to audio files.

For a full list of options you can run "afconvert -h" in the Terminal, or run "afconvert -hf" to view a list of the audio file formats supported by this utility. One of these is the m4r (MPeg-4 Ringtone) format, which is the format that can be used as a ringtone.

Now with your desired audio file on hand, cropped and otherwise prepared, open the OS X Terminal application (in the Applications > Utilities folder) and perform the following steps:

  1. Type the following command, followed by a single space (do not press Enter yet):

    afconvert -f m4af

  2. Drag the audio file from its location in Finder to Terminal, and you should see a full path to the file appear.
  3. Now drag the file to Terminal again to enter another full path to it, but this time press delete to remove the filename suffix, and replace it with ".m4r," so the command will look something like the following (in this example, the initial file is an mp3):

    afconvert -f m4af /path/to/file.mp3 /path/to/file.m4r

  4. Press Enter to execute the command, and a new file in the .m4r format will be placed in the same location as the original.

Once this procedure is done, drag the new .m4r file into iTunes, and it should show up in the ringtones section of your iTunes library. From here, you can sync it with your iPhone or iPad, and then access it in the Sounds section of your iPhone's settings to use it for various notifications.



Questions? Comments? Have a fix? Post them below or !
Be sure to check us out on Twitter and the CNET Mac forums.
The MacFixIt blog can be found directly at http://www.macfixit.com