Created
July 9, 2011 02:08
-
-
Save adilsoncarvalho/1073217 to your computer and use it in GitHub Desktop.
Script to convert CAF files to MP3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# a script to convert every CAF sound file in the current | |
# directory to a corresponding AIF sound file. | |
# | |
# author: alvin alexander, devdaily.com | |
# | |
# This work is licensed under the Creative Commons Attribution-Share Alike 3.0 | |
# United States License: http://creativecommons.org/licenses/by-sa/3.0/us/ | |
# | |
# I've modified this script originally written in: | |
# http://www.devdaily.com/mac-os-x/convert-caf-sound-file-aif-aiff-mp3-format | |
IFS=$'\n' | |
# list all CAF files in the current directory. | |
# (the -1 character in this line is a "one", not an "el") | |
for INFILE in $(ls -1 *.caf) | |
do | |
# get the base filename by stripping off the ".caf" part | |
baseFilename=`basename "${INFILE}" .caf` | |
# determine the preliminary output filename | |
outfile="${baseFilename}.mp3" | |
# convert all spaces to hyphens | |
outfile=`echo $outfile | tr -s " " "-"` | |
echo "Converting \"$INFILE\" to \"$outfile\" ..." | |
# now convert the CAF file to an AIF file | |
afconvert -f mp4f -d aac "$INFILE" "$outfile" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# now convert the CAF file to an MP3 file | |
afconvert -f mp4f -d aac "$0" "$1" |
Somebody did that already. See http://www.bigasoft.com/articles/how-to-convert-caf-audio.html
Or just try a third-party software to convert CAF to WAV, MP3, AIFF, ALAC and more. In this case, you may prefer to this guide: http://www.faasoft.com/articles/caf-to-wav-converter.html
Avdshare Audio Converter is highly recommended to convert caf files to any other audio format like mp3, aac, m4a, wav, wma, flac, aiff etc
Here is the step by step guide: https://www.avdshare.com/caf-to-mp3-converter
iDealshare VideoGo also works great to convert caf to aiff, mp3, wav, wma, aac, m4a etc with this step by step guide: https://www.idealshare.net/caf-to-mp3-converter.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may also refer to this detailed guide to convert caf to mp3, wav, aiff, aac, apple lossless m4a and etc at http://www.allavsoft.com/how-to/convert-caf-to-mp3-wav-m4a-aiff-aac.html