#!/bin/sh

BITRATE=192

if test $# -ne 1
then
	echo "usage: ./wav2mp3 <dir>"
	exit 1
fi

cd "$1"

for i in *
do
	if test -f "$i"
	then
		mplayer "$i" -ao pcm -aofile tmp.wav
		lame -h -b 4BITRATE tmp.wav "$i.mp3"
		rm tmp.wav
	fi
done
