#!/bin/csh
#
# [gfc] Normalize the volume of one wav file.
# This works on a stereo file, but
# both channels get normalized to the same level
#

set vol = `sox $1 -e stat -v |& cat -`
echo $1 needs volume adjustment factor of $vol
if ( "$vol" != "1.000" ) then
	echo adjusting $1
	sox -v $vol $1 adjustedfile.wav
	mv -f adjustedfile.wav $1
endif

exit
