Does Android TTS support Speech Synthesis Markup Language?

前端 未结 3 949
别跟我提以往
别跟我提以往 2020-12-09 11:55

Passing the following SSML (Speech Synthesis Markup Language) document to the com.svox.pico TextToSpeech engine resulted in a reading of the XML body but no control from the

相关标签:
3条回答
  • 2020-12-09 12:20

    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.

    0 讨论(0)
  • 2020-12-09 12:21

    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);
    
    0 讨论(0)
  • 2020-12-09 12:23

    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).

    0 讨论(0)
提交回复
热议问题