#!/bin/sh -x

_dir="$PWD/audiotest"
mkdir "$_dir"

for i in *.flac; 
do 
	_tmp="$_dir/${i%%.flac}"
	# create reference wav
	flac -df "$i" -o "${_tmp}.wav"
	# encode to 128kbit mp3
	lame --cbr -b 128 "${_tmp}.wav" "${_tmp}-128.mp3"
	# encode to 320kbit mp3
	lame --cbr -b 320 "${_tmp}.wav" "${_tmp}-320.mp3"
	# encode to VBR(new) Quaity 5 mp3
	lame --vbr-new -b 96 -B 320 "${_tmp}.wav" "${_tmp}-VBR96.mp3"
done
