[Howto]Converting an Audio File to an iPhone Ringtone
Here is a simple step to convert an audio file to an iPhone ringtone without install extra software/app/add-ons on your Mac OS X through the command line.
P.S. Sorry about misspelled the word "Command" in the video.
The iPhone uses the m4r ringtone format, which is a variant of the m4a audio file type. We'll be using the afconvert command to take an existing audio file and convert it directly to m4r. The general syntax to use is as follows:
afconvert [original-audio-file] [ringtone-file] -f m4af
For example, we'll take a short song called "Waiting" from the iTunes library and convert it into an m4r that will sit on the desktop:
afconvert ~/Music/iTunes/iTunes\ Media/Music/Shook/Waiting.mp3 ~/Desktop/Waiting.m4r -f m4af
Going a step further, we'll convert an audio track (mp3 in this case) into a m4r, then import it directly into iTunes by opening it through there:
afconvert ~/Music/sample.mp3 ~/Desktop/sample.m4r -f m4af && open ~/Desktop/sample.m4r
Yes you can drop m4r files directly into the Tones folder instead, but iTunes must be launched either way to import it.
You will still need to sync the ringtone over to the iPhone yourself unless you have automatic syncing turned on, once it's on the iPhone, set it as your normal ringtone through Settings Sounds, or assign it to a contact if you'd rather it be unique to a person.