eXTReMe Tracker
Aug 082012
 

Here’s a nifty little script I found.

You need to run it within the directory containing the wma files:

#!/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 -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done

#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done

rm audiodump.wav

If you aren’t happy with underscores and want your spaces back, run this on the command line:

for i in `ls *.mp3`; do p=`echo $i | tr '_'  ' '`; mv $i "$p"; done

They will be in the proper format now, and google music compatible.