开发者

What is the proper syntax for the phoneme attribute in Android's TTS XML?

开发者 https://www.devze.com 2023-04-01 02:10 出处:网络
My understanding is that this X-SAMPA XML sample, like other samples here and even here & here, is supposed to sound something.

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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号