Convert caf to aif to mp3 on mac
Fri Oct 28 22:04:05 2011
mp3 to caff
Getting from mp3 to caff is easy.
# /usr/bin/afconvert -f caff -d LEI16 [mp3_input_file] [caf_output_file]
Pretty straightforward, huh?
caff to aiff to mp3
Getting from caff to mp3 is not so easy. You have to convert it to aiff before converting it to mp3
# /usr/bin/afconvert -f AIFF -d I8 [input file]
This command will get you a .aif file.
Using iTunes to convert .aif to .mp3
To convert using iTunes, first go to File > Add to Library and select your audio files. Next, you may have to change your import settings. Either use cmd+, or go iTunes > Preferences... and click the "Import Settings..." button. Change "Import Using" to "MP3 Encoder", press OK and close the Preferences window. Now to create the mp3 version, just select your files in the iTunes library and Advanced > Create MP3 Version. You can then right click on the newly created file and choose "Show in Finder" to get to it.
Using Audacity to convert .aif to .mp3
You can also use Audacity to open the .aif and export it in .mp3 format. Note however that you will need to download a file called libmp3lame.dylib (which you can get from here at time of writing this) and place it in /usr/local/lib/. And if you don't know where that is because it's a hidden folder by default, just click on your desktop and press the shortcut cmd+shift+G and type it in manually
Batch convert via terminal
And finally... here's how to batch convert a whole folder using terminal
# cd [folder containing audio files] # ls | xargs -I {} /usr/bin/afconvert -f AIFF -d I8 {}
Hope it helps
Tweet