1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#!/bin/sh
# Copyright 2001 Sun Microsystems, Inc.
# All Rights Reserved. Use is subject to license terms.
#
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL
# WARRANTIES.
#
# # This test script first runs the FreeTTS with our first utterance file,
# dumps the wave in text form, and compares (diff) it with our standard
# wave form file for our first utterance (first.wave.txt). This test will
# tell you how many lines differ from the standard wave form file.
#
# (Reminder: our 'first utterance file' is "Hello world. This is Duke
# coming to you from inside the java virtual machine. I'm happy to have
# a voice because I've been meaning to tell you how much I care.")
#
# REF=../../../../../data/alice2.flite.v1.0-beta.rel
REF=utterance.ref.res
NEW=utterance.res
grep $1 $REF | grep -v Relation > t.$1.1
grep $1 $NEW | grep -v Relation > t.$1.2
pr -mt t.$1.1 t.$1.2 | sed 's/=/ /g' | awk ' {
name = $1;
diff = ($2-$4);
if (diff < 0) {
diff = -diff;
}
if (diff > 1e-05) {
# print $2, $4, diff
count++;
}
tot++;
}
END {
if (count == 0) {
status = "Test Passed.";
} else {
status = "Test FAILED.";
}
label = name " " count " differences of " tot;
printf("%40.40s. %s\n", label, status);
}
'
|