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.

klatt.test 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. # Test a command for presence and ability to output the sha1 hash of a file.
  3. check_hashcmd() {
  4. which $1 &&
  5. $1 </dev/null 2>/dev/null |
  6. awk '{if ($1 != "da39a3ee5e6b4b0d3255bfef95601890afd80709") { exit 1; }}'
  7. }
  8. test_voice () {
  9. VOICE=$1
  10. EXPECTED=$2
  11. TEST_TEXT=$3
  12. echo "testing ${VOICE} ... "
  13. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  14. src/espeak-ng --stdout -v ${VOICE} "${TEST_TEXT}" | \
  15. $sha1sum | awk '{ print $1 }' > actual.txt
  16. echo "${EXPECTED}" > expected.txt
  17. diff expected.txt actual.txt || exit 1
  18. }
  19. # Test some common commands to find the correct one for the system being tested on.
  20. echo -n "checking for SHA1 hashing command ... "
  21. if check_hashcmd sha1sum; then
  22. sha1sum=sha1sum
  23. elif check_hashcmd sha1; then
  24. sha1sum=sha1
  25. elif check_hashcmd shasum; then
  26. sha1sum=shasum
  27. else
  28. echo "no"
  29. exit 1
  30. fi
  31. echo -n "checking if klatt is installed ... "
  32. if [ "`which klatt`" != "" ]; then
  33. echo "yes"
  34. else
  35. echo "no"
  36. exit
  37. fi
  38. test_voice en+klatt 2d910bd0bf0735e479166302ad68ca245360b6f4 "The quick brown fox jumps over the lazy dog"
  39. test_voice en+klatt2 d986302f525b455222f7cb77d70425ad9e524207 "The quick brown fox jumps over the lazy dog"
  40. test_voice en+klatt3 71487b8cd764bbbffeee4545c9e742540d381fec "The quick brown fox jumps over the lazy dog"
  41. test_voice en+klatt4 377767780368115863cde5cc11c0203cfdd48476 "The quick brown fox jumps over the lazy dog"
  42. test_voice en+klatt5 62f7afeb70d83b9a934b3be71c8ab89bd562079d "The quick brown fox jumps over the lazy dog"