#!/bin/csh
#
# Convert a bunch of files to .cdr format then back to .wav format,
# This changes the block count to one that's compatible with cd recording.
# This is mostly superseded by the cdrdao -pad option.
#
foreach file (*.wav)
	set sname=`echo $file | awk -F "." '{print $1}'`
	echo converting $file to $sname.cdr
	sox $file $sname.cdr
	rm -f $file
	echo converting $sname.cdr back to $file
	sox $sname.cdr $file
	rm -f $sname.cdr
end

exit
