#!/bin/bash
#
# Dump wma to mp3
PATH=/opt/lame-3.97/bin:/opt/mplayer/bin:$PATH
for i in *.wma
do
if [ -f $i ]; then
rm -f audiodump.wav
mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader "$i"
dest=`echo "$i"|sed -e 's/wma$/mp3/'`
lame -h -m j --vbr-new -b 196 audiodump.wav "$dest"
rm -f audiodump.wav
fi
done