eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mbrola.test 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. # include common script
  3. . "`dirname $0`/common"
  4. # and run needed checks before
  5. is_hash
  6. is_mbrola
  7. check_voice_folder() {
  8. voice_file=${1#mb-} # remove mb- prefix
  9. voice_file=${voice_file%+*} # remove variant suffix
  10. if [ -f "/usr/share/mbrola/$voice_file" ]; then
  11. voice_file="/usr/share/mbrola/$voice_file"
  12. elif [ -f "/usr/share/mbrola/$voice_file/$voice_file" ]; then
  13. voice_file="/usr/share/mbrola/$voice_file/$voice_file"
  14. elif [ -f "/usr/share/mbrola/voices/$voice_file" ]; then
  15. voice_file="/usr/share/mbrola/voices/$voice_file"
  16. else
  17. voice_file=""
  18. fi
  19. }
  20. test_voice () {
  21. MBVOICE=$1
  22. EXPECTED=$2
  23. TEST_TEXT=$3
  24. check_voice_folder $MBVOICE
  25. if [ "$voice_file" != "" ]; then
  26. echo "testing ${MBVOICE} ${TEST_TEXT} ... "
  27. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  28. src/espeak-ng --stdout -v ${MBVOICE} "${TEST_TEXT}" | \
  29. $sha1sum | awk '{ print $1 }' > actual.txt
  30. echo "${EXPECTED}" > expected.txt
  31. diff expected.txt actual.txt || exit 1
  32. else
  33. echo "$MBVOICE was not tested"
  34. fi
  35. }
  36. test_voice mb-fr4 31fae066f45d4a9dc56289344f28dd00bce77875 "Bonjour"
  37. test_voice mb-fr4+announcer f62c9cad15df194ac7cedfcfb36b6d9ccc70a634 "Bonjour" # mbrola + variant