Here is bash script I use it does some extra stuff I like but you can cut out what you want pretty easy. I can run this in any directory to convert all to mp3 then it splits up the file for me which is what you want the syntax and program name are at the bottom. Good luck
#! /bin/bash
echo " thanks: http://geekyquotes.blogspot.com/2008/01/linux-convert-real-media-files-to.html"
# if no parameters are passed stay in current directory
if [ "$1" != "" ] ; then
cd "$1"
fi
ls > /tmp/convert_file_list
cat /tmp/convert_file_list |while read line2; do
extension="${line2##*.}"
ORIGINAL_NAME=${line2}
STRIPPED_FILE_NAME=${line2/.$extension/}
shift
MOVED_NAME=$@.${extension}
#echo "strippedfilename:${STRIPPED_FILE_NAME} EXTENSION:${extension} orig_name:${ORIGINAL_NAME}"
#mplayer -quiet -vo null -vc dummy -ao pcm:file="$1.wav" "$1.$2"
if [ "$extension" != "wav" ] ; then
mplayer -vo null -vc dummy -ao pcm:file="${STRIPPED_FILE_NAME}.wav" "${ORIGINAL_NAME}" < /dev/null > /dev/null 2>&1 &
sleep 1
fi
lame "${STRIPPED_FILE_NAME}.wav" "${STRIPPED_FILE_NAME}.mp3"
sleep 1
mkdir -p mp3_output
mv *.mp3 mp3_output
cd mp3_output
mpgtx -5 "${STRIPPED_FILE_NAME}.mp3" -b "${STRIPPED_FILE_NAME}"
#rm "${STRIPPED_FILE_NAME}.wav"
done