1

For example, the speech output of -5.6 is "five point six", not "negative five point six". The negative part is always missing. How to get speech output of negative numbers using festival speech synthesis?

Zanna
  • 70,465
dhiya
  • 953
  • Can you preprocess the text to speak in advance and replace "-5.6" with "negative 5.6" literally? That should be easy by running it through something like sed s/\B-([0-9])/negative \1/' without having to know anything about how festival works. – Byte Commander Apr 11 '17 at 20:46
  • @ Byte Commander I have already tried that. What I have done resulted in reading "dot" instead of "point", ie "negative five dot six" instead of "negative five point six". – dhiya Apr 12 '17 at 14:45
  • @ Byte Commander Yep... That works. Thanks a lot – dhiya Apr 13 '17 at 09:02
  • @ByteCommander that looks very much like an answer to me. Why not post it as such? – Elder Geek Apr 13 '17 at 22:27
  • @DavidFoerster that looks very much like an answer to me. Why not post it as such? – Elder Geek Apr 13 '17 at 22:28

1 Answers1

0

The speech synthesis engine may produce more appropriate results if the input data uses an actual minus sign “−” (U+2212) to prefix negative numbers.

To replace all dashes “-” (U+002D) in front of digits with minus signs you may use this substitution command:

sed -re 's/\B-([0-9])/−\1/g' input.txt > output.txt
David Foerster
  • 36,264
  • 56
  • 94
  • 147