Skip to content

Instantly share code, notes, and snippets.

@scottjacksonx
Created April 8, 2010 02:00
Show Gist options
  • Save scottjacksonx/359696 to your computer and use it in GitHub Desktop.
Save scottjacksonx/359696 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Turns an mp3 file into an iPhone ringtone file.
if [ $1 = "-help" ]; then
echo "
Usage:
iprc -help | before_file after_file
Arguments:
[-help]: Optional argument. If used, must be put as the first argument.
before_file: path to the audio file you want to convert into a ringtone.
after_file: path to the ringtone file you want to make.
NOTE: for best results, after_file should not have a .m4r file extension.
"
else
BEFORE=$1
AFTER=$2
afconvert -v -f "m4af" -d "aac@44100" $BEFORE $AFTER
mv $AFTER $AFTER.m4r
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment