Skip to content

Instantly share code, notes, and snippets.

@KingYes
Created March 11, 2014 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KingYes/9480100 to your computer and use it in GitHub Desktop.
Save KingYes/9480100 to your computer and use it in GitHub Desktop.
WMA to MP3 Coverctor.
#!/bin/bash
current_directory=$( pwd )
#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done
#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader "$i" && lame --vbr-new -V4 -m s audiodump.wav -o "$i"; done
#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done
#add spaces as origins (if there are spaces)
for i in *.mp3; do mv "$i" "`echo "$i" | tr '_' ' '`"; done
rm audiodump.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment