[SOLVED] Text to Speech (TTS) output of negative numbers in German

Tags: #<Tag:0x00007f4334ef4240>

I faced the problem that negative (temperature) values (as occurring these days outside…) are converted into speech without the “minus”, e.g. “-6°C” is spoken as “sechs”.
This problem occurs with MaryTTS as well as picoTTS. (Strangely enough, when using Spanish or Italian in picoTTS, the “minus” was spoken).
Finally I detected by chance that the “minus” is omitted when the preceeding word in the sentence (see below) has no “blank” (pause) before the variable with the number.

say ( “Die Aussentemperatur beträgt” (AussenTemperature.state as Number).intValue + " Grad") }
// the “minus” is not spoken
say ( “Die Aussentemperatur beträgt_” (AussenTemperature.state as Number).intValue + " Grad") }
// the “minus” is spoken

I had the problem that “one-one” was said instead of “eleven”.
my solution:

vtemptext = vtemptext + "Draußen sind es nur <say-as interpret-as=\"cardinal\">" + Graddraussen + "</say-as> Grad." 

It also works with the minus.
Not so nice is the value 1 or -1. Google then says “… (minus) eins Grad”