9

My understanding is that this X-SAMPA XML sample, like other samples here and even here & here, is supposed to sound something.

String text = "<speak xml:lang=\"en-US\"> <phoneme alphabet=\"xsampa\" ph=\"faIv\"/>.</speak>";
mTts.speak(text, TextToSpeech.QUEUE_ADD, null); 

However, for some strange reason, it doesn't say anything (total silent).

What am I missing?

To clarify: My TTS sample app is setup OK: If I change that . before that </speak> tag to any word, the Android TTS just says that word fine. My only problem is that I am not able to utilize the <phoneme alphabet=\"xsampa\" ph=\"faIv\"/> in any way.

I understand that a . is supposed to be silent, but then according to the posters of those samples, it's supposed to sound the XSAMPA phonemes in the XML. What am I missing?

Community
  • 1
  • 1
an00b
  • 11,338
  • 13
  • 64
  • 101

2 Answers2

2

The correct syntax for what you are trying to do is exactly as you posted in your question. If your phone is setup to use the default Pico TTS, that is.

Under Settings > Voice input & output > Text-to-speech settings > Default Engine make sure that Pico TTS is selected and try the same code now.

ateiob
  • 9,016
  • 10
  • 44
  • 55
  • Wow! That was it. This problem has been driving me crazy for a very long time without even suspecting that a different TTS engine might not support XSAMPA. Once I selected back Pico, the syntax above works as expected. Thanks! – an00b Sep 07 '11 at 12:08
1

The correct syntax for the phoneme element is documented in the W3C Speech Synthesis Markup Language documentation.

As mentioned in the answer Stack Overflow question 3648239 not all elements are parsed properly.

There is further clarification of the parsing error in this google groups forum post however it would appear that these errors can be ignored.

You may be able to find more information in the TTS-for-android site on google groups by posting your question there.

I have been unable to read the samples as the website is down. I'm not sure if this is a temporary problem ubt I will check back at a later date to see if I can find them.

Community
  • 1
  • 1
Moog
  • 10,193
  • 2
  • 40
  • 66
  • Thanks +1 for the research. In my desperate search for a possible explanation I came across all the links you posted but that didn't help solve the mystery. See accepted answer above. – an00b Sep 07 '11 at 12:10