Skip to content

Instantly share code, notes, and snippets.

@anttti
Created June 14, 2015 09:52
Show Gist options
  • Select an option

  • Save anttti/8ddeeefbb763300bc51b to your computer and use it in GitHub Desktop.

Select an option

Save anttti/8ddeeefbb763300bc51b to your computer and use it in GitHub Desktop.
Convert a directory of wav files to caf
#!/bin/bash
# This line required to prevent trying to convert a file named "*"
# if the directory passed in as the parameter is empty
shopt -s nullglob
for f in $*
do
echo "Converting $f"
cafFileName=$(echo $f | sed -e 's/wav/caf/g')
afconvert -d LEI16 -f 'caff' "$f" "$cafFileName"
done
@anttti
Copy link
Author

anttti commented Jun 14, 2015

Usage: ./convert-to-caf.sh directory/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment