Debian Codegraph @

tests/mbrola.test

raw
1 #!/bin/sh
2 # include common script
3 . "`dirname $0`/common"
4 # and run needed checks before
5 is_hash
6 is_mbrola
7
8 check_voice_folder() {
9 voice_file=${1#mb-} # remove mb- prefix
10 voice_file=${voice_file%+*} # remove variant suffix
11 if [ -f "/usr/share/mbrola/$voice_file" ]; then
12 voice_file="/usr/share/mbrola/$voice_file"
13 elif [ -f "/usr/share/mbrola/$voice_file/$voice_file" ]; then
14 voice_file="/usr/share/mbrola/$voice_file/$voice_file"
15 elif [ -f "/usr/share/mbrola/voices/$voice_file" ]; then
16 voice_file="/usr/share/mbrola/voices/$voice_file"
17 else
18 voice_file=""
19 fi
20 }
21
22 test_mb () {
23 MBVOICE=$1
24 EXPECTED=$2
25 TEST_TEXT=$3
26 check_voice_folder $MBVOICE
27 if [ "$voice_file" != "" ]; then
28 test_wav $MBVOICE $EXPECTED $TEST_TEXT $TEST_TEXT
29 else
30 echo "$MBVOICE was not tested"
31 fi
32 }
33
34
35 test_mb mb-fr4 31fae066f45d4a9dc56289344f28dd00bce77875 "Bonjour"
36 test_mb mb-fr4+announcer f62c9cad15df194ac7cedfcfb36b6d9ccc70a634 "Bonjour" # mbrola + variant