.wma to .wav

wma2wav
# function wma2wav { if [ ! -f "$1" ]; then echo "File $1 not found!" else wav=`ls "$1" | sed -e 's/.wma/.wav/' | tr -d "*"` mplayer -ao pcm "${1%%.[Ww][Mm][Aa]}.wav" "$1" && mv audiodump.wav "$wav" && unset wav || echo "There was a problem with the conversion process!" fi } if [ $# -eq 1 -a -d "$1" ]; then for file in $1/*.[Ww][Mm][Aa]; do   wma2wav "$file" done exit fi for file in $*; do  wma2wav "$file" done if [ $# -lt 1 ]; then echo echo "Usage:	wma2wav myfile.wma" echo "	wma2wav /directory/containing/wma/files" echo "	wma2wav myfile.wma myfile2.wma myfile3.wma" # You have to use quotations for the arguement below. # Failure to do so will result in only one file being # converted. Namely, the first one it comes across... echo '	wma2wav "*.wma"' echo echo "For converting .wma's that have spaces in the" echo 'name, use the directory option OR "*.wma"' echo exit fi exit
 * 1) !/bin/bash
 * 1) wma to wav
 * 1) convert all wma files in directory
 * 1) One or more wma files were given
 * 1) Not enough information