Skip to content

Instantly share code, notes, and snippets.

@remino
Forked from anonymous/wma2mp3.sh
Last active December 10, 2015 16:58
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 remino/4464561 to your computer and use it in GitHub Desktop.
Save remino/4464561 to your computer and use it in GitHub Desktop.
Find and convert WMA files into MP3, including audio and metadata, using ffmpeg.
#!/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