Does Android TTS support Speech Synthesis Markup Language? Does Android TTS support Speech Synthesis Markup Language? android android

Does Android TTS support Speech Synthesis Markup Language?


I've been experimenting with SSML and it seems that the TTS engine wraps its input automaticly with the root <speak> element, so if you leave it out, then it works fine and you don't get a parser error.

Example:

String text = "Testing <phoneme alphabet=\"xsampa\" ph=\"&#34;{k.t@`\"/>.";mTts.speak(text, TextToSpeech.QUEUE_ADD, null);


The answer seems to be "sort of". Not all the SSML tags are supported yet, but some test examples of the use of the <phoneme> tag are at https://android.googlesource.com/platform/external/svox/+/89292811b7fe82e5c14fa13942779763627e26db

Though the test examples produce the desired speech output, they also produce XML parser error messages in logcat. I've opened an issue about these seemingly incorrect error messages at the Android issue tracker (issue 11010).


It does appear that android.speech.tts at SDK level 23 supports a subset of SSML. Speech text can be wrapped in <speak> tags, and <say-as> is observed, while <break> is not. There is no documentation regarding SSML support.