Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2013 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4464560 to your computer and use it in GitHub Desktop.
Save anonymous/4464560 to your computer and use it in GitHub Desktop.
#! /bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $(basename $0) directory"
echo
echo "Specify a directory containing wma files to convert into mp3."
exit 1
fi
find "$1" -iname '*.wma' | while read i; do
echo "Converting $i..."
ffmpeg -y -i "$i" -ab 196k "${i/%\.[wW][mM][aA]/}.mp3" < /dev/null
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment