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?
Also known as "speech synthesis", TTS enables your Android device to "speak" text of different languages.
java file to add TextToSpeech code. Modify layout XML file res/layout/activity_main. xml add any GUI component if required. Run the application and choose a running android device and install the application on it and verify the results.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With