#!/bin/bash

quality=128
title=Converting
file=$@

if [ "$file" ]; then
cd `pwd`
lame -b $quality "$file" 2>&1 | awk -vRS='\r' '(NR>3){gsub(/[()%|]/," ");print $2; fflush();}' | zenity --progress --auto-close --auto-kill --title="$title" --text="$title $file at $quality kbps to $file.mp3"
fi
