What is the correct syntax for the phoneme attribute in Android TTS XML?

I understand that this XML sample of X-SAMPA , like the other samples here and even here and 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, he says nothing (completely silent).

What am I missing?

To clarify: my TTS test application is configured OK: if I changed this one . before this </speak> for any word, Android TTS will just say that word in order. My only problem is that I can’t use <phoneme alphabet=\"xsampa\" ph=\"faIv\"/> .

I understand that a . should be quiet, but then, according to the posters of these samples, it should sound Xonox XSAMPA in XML. What am I missing?

+8
android text-to-speech ssml
source share
2 answers

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

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

+1
source share

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

As mentioned in the answer "Stack overflow question 3648239, not all elements are parsed properly.

The following parsing error is explained in this google groups forum post , however, it seems that these errors can be ignored.

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

I could not read the samples because the site is down. I am not sure if this is a temporary problem. Ubt. I will come back later to find out if I can find them.

+1
source share

All Articles