Skip to content

Instantly share code, notes, and snippets.

@shinka-cb
Created April 6, 2016 07:58
Show Gist options
  • Select an option

  • Save shinka-cb/f28bb458e1f8be12d3eee98967cb0b30 to your computer and use it in GitHub Desktop.

Select an option

Save shinka-cb/f28bb458e1f8be12d3eee98967cb0b30 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Usage: ./make_iTunesPlus.sh hoge.wav foo.wav ...
PRE_IFS=$IFS
IFS=$'\n'
for song in $@; do
echo "Processing: ${song}"
filename=$(basename $song)
afconvert $song $filename.caf -d 0 -f caff --soundcheck-generate
afconvert $filename.caf -d aac -f m4af -u pgcm 2 --soundcheck-read -b 256000 -q 127 -s 2 $filename.m4a
rm $filename.caf
done
IFS=$PRE_IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment