#!/bin/sh

date >>LOG
echo ARGS: $0 $* >>LOG

rec=$1;
shift;
HTKmfccname=$1;
shift;
mfccname=${1:-${HTKmfccname#HTK}}
shift;
MetaData=$*
test -n "$MetaData" || MetaData=../metadata/*.fiat

function g_die() { x="ERR: $*"; echo $x; echo $x 1>&2; exit 1; }

for f in $MetaData
do
  python bin/make_mfcc_files_for_rec.py -lazy -F$mfccname $f
  python bin/rec_all.py $rec $HTKmfccname $f || g_die "Too many errors in rec_all.py" || exit 2
done
