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.

ssml.test 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. # include common script
  3. . "`dirname $0`/common"
  4. # and run needed checks before
  5. is_hash
  6. test_ssml_audio() {
  7. TEST_NAME=$1
  8. EXPECTED=$2
  9. TEST_TEXT=$3
  10. echo "testing ${TEST_NAME}"
  11. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  12. $VALGRIND src/espeak-ng --stdout -m "${TEST_TEXT}" \
  13. > actual.txt || exit 1
  14. < actual.txt $sha1sum | awk '{ print $1 }' > sum.txt
  15. echo "${EXPECTED}" > expected.txt
  16. diff expected.txt sum.txt || exit 1
  17. }
  18. test_ssml() {
  19. INPUT=$1
  20. if [ "$2" = "punct" ]
  21. then
  22. PARAMETERS="--punct -x"
  23. else
  24. PARAMETERS="-v en-US --ipa=2"
  25. fi
  26. echo "testing ${INPUT}"
  27. cp $(dirname $INPUT)/$(basename ${INPUT%.*}).expected expected.txt
  28. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  29. $VALGRIND src/espeak-ng -m -q $PARAMETERS -f ${INPUT} \
  30. > actual.txt || exit 1
  31. diff expected.txt actual.txt || exit 1
  32. }
  33. for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done
  34. for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done
  35. # test_ssml_audio "<prosody>" 88fccb35536158f25f4ae44a03fb005fef95c99b "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>"
  36. # #410 is a bug in SSML. Sentence termination causes prosody stack to misfunction.
  37. # Hash 8d3bace is the buggy version and should fail:
  38. test_ssml_audio "<prosody> bug #410" 8d3bace9548ae73c4770a73c88c6f65e848b45cf "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low. </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>"
  39. test_ssml_audio "<audio>" 5134c1db757b2d6b8d1f3f2416124462e401b4c6 "<speak>ha: <audio src=\"$PWD/phsource/h/ha.wav\"></audio></speak>"