This particular utility is called “afconvert” and has been included in OS X since 2003. “afconvert” stands for “Audio File Convert,” and as the name suggests, it lets you convert one audio file to another format. This utility also lets you perform a number of other actions on audio files such as managing quality settings, extracting channels, managing bitrates and the sort. To get started, simply type in the terminal: This will display a list of the audio file formats supported by this utility. One of these formats is the format that is used for ringtones, which is m4r (Mpeg-4 Ringtone).
To start, drag your audio file to some handy location such as the Desktop. Make sure the file is cropped to the length you want it. Once your file is prepared, open Terminal from the Spotlight and perform the following steps:
Enter the following command in Terminal, followed by a single space (do not press Enter yet):
Drag the audio file from its location to Terminal, and you’ll see a full path to the file appear, similar to the screenshot below:
Now drag the file to Terminal again, which will result in entering another full path to it. But in this new path, delete the filename suffix (.mp3, .aac etc.) and replace it with “.m4r”. The full command will look something similar to the one below:
Press Enter to execute the command, and a new file with the .m4r format will be placed in the same location as the original.
Once this whole procedure is finished, simply drag the new .m4r file into iTunes or import it into your library. It should now show up in the ringtones section of your iTunes library. From here you can sync it with your iPhone or iPad. On your iPhone/iPad, simply navigate to “Settings -> Sounds” to use this ringtone for various notifications.