I have some code:
tts.speak(Integer.toString(score), TextToSpeech.QUEUE_ADD, null);
Where score
is an int
between 0 and 100. Occasionally, but not very often, I will hear the digits ready separately ie "Eight Six" instead of "Eighty Six." Has anyone else experienced this? Any ideas short of a giant switch statement?
String to_read = "zero";
switch (score) {
case 1: to_read = "one"; break;
case 2: to_read = "two"; break;
case 3: to_read = "three"; break;
case 4: to_read = "four"; break;
case 5: to_read = "five"; break;
...
}
tts.speak(to_read, TextToSpeech.QUEUE_ADD, null);
On second thought, a giant switch statement won't work very well unless we are going to add a hundred new strings to our Strings.xml and have them all translated...