我正在WP8上实现简单的语音重组和合成(SSML)。当我在模拟器中测试应用程序时,一切都很好。但是当我在物理设备(HTC Windows Phone X8)上测试应用程序时,SSML合成会出现一个问题。这个SSML代码工作正常:
await synth.SpeakSsmlAsync(@"<speak version=""1.0""
xmlns=""http://www.w3.org/2001/10/synthesis"" xml:lang=""en-US"">
<voice gender=""female"">
Volume level 100.
</voice>
</speak>");
这个SSML:
await synth.SpeakSsmlAsync(@"<speak version=""1.0""
xmlns=""http://www.w3.org/2001/10/synthesis"" xml:lang=""en-US"">
<voice gender=""female"">
<prosody volume=""100.0"">
Volume level 100.
</prosody>
</voice>
</speak>");
抛出异常:
{System.FormatException:
The text associated with this error code could not be found.
at Windows.Phone.Speech.Synthesis.SpeechSynthesizer.SpeakSsmlAsync(String content)
at PhoneApp1.MainPage.<voiceSynth_Click>d__9.MoveNext()} System.Exception
{System.FormatException}
任何人都有任何想法,为什么<prosody>
代码无法在设备上运行?
答案 0 :(得分:1)
问题解决了!
<prosody volume=""100.0""> doesn't work because the number is not integer.
<prosody volume=""100""> it should look like this