Converting Audio Files Using Mac OS X Terminal

I just figured out Mac OS X has a nice command line utility to convert audio files called afconvert . This is a great way to do batch audio conversion with total control over what you’re converting. The basic syntax is:

afconvert -d DATAFORMAT -f FILEFORMAT INPUTFILE OUTPUTFILE

To list the data and file formats supported, simply type:

afconvert -hf

The following script lists all the AIFF file on a directory and converts them to WAV.

ls *.aiff | while read file
do
afconvert -d LEI16 -f 'WAVE' $file `echo $file | sed 's/.aiff/.wav/'`
done
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s