###################################################################### # Converts a .wma media file to .mp3 format. You should also have # installed mplayer (www.mplayerhq.hu/) and lame (lame.sourceforge.net/) # change the parameters if, required. the output filename is the # input filename with .mp3 appended # # Copyright (C) 2007 Srivatsa Kanchi, R # License: GPL # ##################################################################### if (( $# != 1 )); then echo -e "Usage: \n \t/bin/bash $0 \n" exit 1 fi tmpfile1=`mktemp /tmp/temp.XXXXXXXXXX` || exit 1 mplayer -nortc -quiet -vo null -vc null \ -ao pcm:fast:waveheader:file="${tmpfile1}" "$1" && \ lame --resample 22.05 -b 24 "${tmpfile1}" "${1}.mp3" if (( !$? )); then echo "failed with error code $?" else echo "Done!" fi rm -f "${tmpfile1}"