if test $# -eq 0
then
        echo "\n   nextfloats converts AIFF and NEXT integer format "\
		"\n   sound files into NEXT float sound files using "\
                "\n   sfconvert. The source is saved.\n\n\
        \nUsage: \n\n   nextfloats [.aiff or .snd sound file(s)]\n\n"
else
   while test $# -gt 0
   do
	
	inttest=`sfinfo -s $1 |  awk '{print $6}'`

        if test $inttest != "16bit"
        then
                echo "THIS IS NOT AN INTEGER FILE!"
		noconvert="$noconvert $1"
		if test ! -s $1
		then
			notfound="$notfound $1"
		fi
        elif test -s $1
	then

	    newname=`echo $1 | sed s/.aiff//g`
	    newname=`echo $newname | sed s/.snd//g`
	    newname="$newname".float.snd
	    
		echo CONVERTING...............................................
                sfconvert $1 $newname format next float 1.0
		
		if test -r $newname
		then
   		    echo ................SUCCESS!
		    convert="$convert $newname"
		else
		    echo .............FIXING FILE...................
		    fixaiff $1
		    echo ............TRY AGAIN ...................
		    sfconvert $1 $newname format next float 1.0
		    if test -r $newname
		    then
			echo ................SUCCESS!
			convert="$convert $newname"
		    else
			echo "I'M HAVING REAL PROBLEMS CONVERTING $1. BYE."
			problemconvert="$problemconvert $1"
		    fi
		fi
   		echo ......................................................DONE!


	else
		notfound="$notfound $1"
        fi
        shift
   done

   if test -n "$convert"
   then echo "\n*******NEW CONVERTED FILES*******:\n\t $convert"
   fi
   if test -n "$noconvert"
   then echo "\n(((((((NON INTEGER FILES)))))))) (No action taken):\n\t $noconvert"
	sfinfo -s $noconvert
   fi
   if test -n "$notfound"
   then echo "\n???????FILES NOT FOUND????????:\n\t $notfound"
   fi
   if test -n "$problemconvert"
   then echo "\n!!!!!!!!! PROBLEM FILES !!!!!!!!!(No action taken):\n\t $problemconvert"
   fi
echo ""
fi
