Skip to content

Instantly share code, notes, and snippets.

@epayet
Last active September 26, 2015 12:37
Show Gist options
  • Save epayet/f82514c8ea546ac2cf5d to your computer and use it in GitHub Desktop.
Save epayet/f82514c8ea546ac2cf5d to your computer and use it in GitHub Desktop.
Shell script to convert wma files to mp3. Ex: ./conv-script.sh .
#!/usr/bin/env bash
set +o posix
cd $1
find . -type f | grep wma$ > wma-files.txt
readarray -t files < wma-files.txt
for file in "${files[@]}"; do
out=${file%.wma}.mp3
ffmpeg -i "$file" -map_metadata 0:s:0 "$out"
rm "$file"
done
rm wma-files.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment