upstream version 1.2.2
[debian/freetts] / tests / data / gen_flite_data.sh
1 #!/bin/bash
2 # Generate data from a given version of flite to be used in freetts tests.
3 #
4 # Copyright (c) 2001-2003 Sun Microsystems, Inc.
5 # All Rights Reserved.
6 #
7 # See the file "license.terms" for information on usage and
8 # redistribution of this file, and for a DISCLAIMER OF ALL
9 # WARRANTIES.
10 #
11 # files generated:
12 # flite.<version>.TokenGame.rel
13 # flite.<version>.alice2.rel
14 # flite.<version>.time.rel
15 # flite.<version>.wave.first.float.txt
16 # flite.<version>.wave.time.float.txt
17
18 TIME="06:51"
19
20 usage() 
21 {
22     echo "usage: $0  flite_bin_directory"
23     exit -1
24 }
25
26 if [ "$1" = "" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ ! -d $1 ]; then
27     usage
28 fi
29
30 FLITE=$1/flite
31 FLITE_TIME=$1/flite_time
32
33 VERSION=v`$FLITE --version | awk '/version/ {print $2}' | sed 's/flite-//g'`
34
35 echo "Running on flite version '$VERSION', using time '$TIME' for time tests."
36 echo "Note: flite must be the Sun modified version of flite."
37 echo
38 echo "Make sure you update the version in ../tests/Makefile"
39 echo " and confirm that it is using the same time."
40 echo
41 echo "If output files are new, make sure files are added to CVS."
42 echo
43
44
45 rm -f flite.${VERSION}.TokenGame.rel 2>/dev/null
46 $FLITE -f TokenGame.txt --sets dump_final_relations=on --sets resynth_type=fixed  none > flite.${VERSION}.TokenGame.rel
47
48 rm -f flite.${VERSION}.alice2.rel 2>/dev/null
49 $FLITE -f alice2 --sets dump_final_relations=on --sets resynth_type=fixed  none > flite.${VERSION}.alice2.rel
50
51 rm -f flite.${VERSION}.time.rel 2>/dev/null
52 $FLITE_TIME -set dump_final_relations=on -set resynth_type=fixed $TIME none > flite.${VERSION}.time.rel
53
54 rm -f flite.${VERSION}.wave.first.float.txt 2>/dev/null
55 $FLITE ../wave/08-01-01.wave.text -o flite.${VERSION}.wave.first.float.txt
56
57 # it is undocumented that you can pass a file name into flite_time
58 #   instead of "play" or "none".
59 rm -f flite.${VERSION}.wave.time.float.txt 2>/dev/null
60 $FLITE_TIME $TIME flite.${VERSION}.wave.time.float.txt >/dev/null
61