Apple iPhone ringtones are in M4R file format. They are also encoded in a certain special way and can only be a maximum of 30 seconds in duration. If you want to make your own M4R ringtone files, then you can use the open-source FFmpeg multimedia toolkit which is able to carry out all sorts of media operations.
Here is how you can use FFmpeg to create Apple iPhone compatible ringtones in the M4R format:
- First of all download FFmpeg from https://ffmpeg.org/download.html. Different downloads are available for Mac, Linux and Windows. We downloaded the Windows binary version for our Windows 10 PC. The download was in a zip format, which we extracted to a folder C:\ffmpeg.
- Copy the audio or video files such as good-music.mp3 or music-video.mp4 from which you want to create the ringtones to the working folder, for example, C:\ringtones.
- Open the working folder C:\ringtones in Windows File Explorer, press Alt+D, type cmd and press Enter. This will open the command prompt with C:\ringtones as selected current directory.
- In the command prompt, give the following command to set the PATH variable:
This is because ffmpeg.exe resides in the C:\ffmpeg\bin folder.
- Next in the command prompt give the following command:
ffmpeg -i good-music.mp3 -c:a aac -f mp4 -b:a 128k -ac 1 -t 30 -ss 100 ringtone.m4r
The parameter -ss 100 means that it will extract audio from input media file beginning with 100 seconds. You can change it depending on from where you want to extract the audio file. For example, -ss 0 will extract from the start of the input audio. The above example shows input file good-music.mp3 and output as ringtone.m4r, you can change them according to your own file names.
- Now you have the M4R ringtone ready. You can copy it to your iPhone using the usual data cable method or by uploading it to your iCloud account. If you want to see the ringtone codec information, you can play it in any MP4 ready music player such as XMPlay or VLC media player.
This is how easy it is to create M4R ringtones without having to pay for any expensive software. Just make sure that you do not alter any other parameters from the ffmpeg command. For example, the bitrate has to be 128 kbps without which the ringtone won’t work.