#! /bin/sh
# Automatically rename voices according to the voice name field
VCMP=../vcmp
for i
do
	VN=`vpr -n $i`
	if [ "$?" != "0" ] ; then
		echo "vpr -n $i failed.  Skipping $i..."
		continue
	fi
	NAME=`echo $VN | tr "'"'\&\!\$\|\`\*\"\/\<\>\(\)\{\}\[\]\\' ' ' | tr ' ' '_'`
	echo -n "$i -> V.$NAME"
	if [ -s V.$NAME ] ; then
		echo "   V.$NAME exists."
		echo "Comparing V.$NAME and $i..."
		$VCMP V.$NAME $i
		echo "Skipping $i..."
	else
		mv $i V.$NAME
		echo ""
	fi
done
