问题描述
传递以下SSML(语音合成标记语言)文件到com.svox.pico TextToSpeech引擎导致XML主体的读取,但没有来自音素元件或强调元件控制。这个结果(没有明显的SSML控制)是一台Nexus的同一个运行Android 2.2以及对运行的AVD与SDK级模拟器8。
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 phoneme element or the emphasis element. This result (no apparent SSML control) is the same on a Nexus One running Android 2.2 as well as on the emulator running an AVD with SDK level 8.
String text = "<?xml version=\"1.0\"?>" +
"<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xsi:schemaLocation=\"http://www.w3.org/2001/10/synthesis " +
"http://www.w3.org/TR/speech-synthesis/synthesis.xsd\" " +
"xml:lang=\"en-US\">" +
"tomato " +
"<phoneme alphabet=\"ipa\" ph=\"t&#x259;mei&#x325;&#x27E;ou&#x325;\"> tomato </phoneme> " +
"That is a big car! " +
"That <emphasis> is </emphasis> a big car! " +
"That is a <emphasis> big </emphasis> car! " +
"That is a huge bank account! " +
"That <emphasis level=\"strong\"> is </emphasis> a huge bank account! " +
"That is a <emphasis level=\"strong\"> huge </emphasis> bank account!" +
"</speak>";
mTts.speak(text, TextToSpeech.QUEUE_ADD, null);
是否有Android的TTS引擎支持所有的SSML元素?
推荐答案
答案似乎是之类的。不是所有的SSML标签被支持,但使用的标记的一些试验的例子是在<一href="https://android.git.kernel.org/?p=platform/external/svox.git;a=commitdiff;h=89292811b7fe82e5c14fa13942779763627e26db" rel="nofollow">https://android.git.kernel.org/?p=platform/external/svox.git;a=commitdiff;h=89292811b7fe82e5c14fa13942779763627e26db
The answer seems to be "sort of". Not all the SSML tags are supported yet, but some test examples of the use of the tag are at https://android.git.kernel.org/?p=platform/external/svox.git;a=commitdiff;h=89292811b7fe82e5c14fa13942779763627e26db
虽然测试实例产生所需要的语音输出,他们也产生logcat的XML解析器的错误消息。我约在Android的问题跟踪(问题11010)这些看似不正确的错误信息打开的问题。
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).
这篇关于做Android的支持TTS语音合成标记语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!