Skip to content

Instantly share code, notes, and snippets.

@jhorology
Created December 31, 2014 03:02
Show Gist options
  • Save jhorology/c195d54d509e9fff0293 to your computer and use it in GitHub Desktop.
Save jhorology/c195d54d509e9fff0293 to your computer and use it in GitHub Desktop.
Bulk convert Apple Loops to m4a without re-sampling.
#!/bin/sh
IFS=$'\n'
APPLE_LOOPS='/Library/Audio/Apple Loops'
cd `dirname $0`
echo "" > convert.log
for file in $(find $APPLE_LOOPS -print -type f -name *.caf)
do
newfile=`echo $file | sed "s|^$APPLE_LOOPS/||"`
newdir=`dirname "${newfile}"`
outfile=`basename "${newfile}" .caf`
mkdir -p "${newdir}"
## afinfo --warnings "${file}"
afconvert -v -f m4af -d 0 "${file}" "${newdir}/${outfile}.m4a" 2>&1 | tee -a convert.log
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment