本文介绍了<标记>当由Windows Phone 8.1(rt)中的speechSyntheszer读取时ssml中的标记不会触发任何事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用 SpeechSynthesizer 类 for windows phone 8.1(rt)使用< mark>读取SSML标签。 MediaElement 一个事件 MarkerReached 。 但是我的代码中永远不会触发它。这是我的代码。 string Ssml = @"< speak version ='1.0'" + " xmlns ='http://www.w3.org/2001/10/synthesis'xml:lang ='en-US'>" + " Go from< mark name = \" here \" />在这里,与< mark name = \" there \" /> !有" + "< / speak>" ;; //用于控制和播放音频的媒体对象。 MediaElement mediaElement = this.audio; mediaElement.MarkerReached + = mediaElement_MarkerReached; //用于控制语音合成引擎(语音)的对象。 var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer(); //从纯文本生成音频流。 SpeechSynthesisStream stream = await synth.SynthesizeSsmlToStreamAsync(Ssml); //将流发送到媒体对象。 mediaElement.SetSource(stream,""); mediaElement.Play(); 有人可以告诉您需要做出哪些更改,以便mediaElement在< mark>上引发markerReached事件ssml中的标签。 任何帮助都将受到高度赞赏。 解决方案 我没有看到任何引用此示例的示例,因此我不确定它是否受支持。 我会看到我能为你找到的东西! I am using SpeechSynthesizer class for windows phone 8.1 (rt) to read SSML with <mark> tags. The MediaElementhas an event MarkerReached. But it is never triggered in my code. Here is my code.string Ssml = @"<speak version='1.0' " + "xmlns='http://www.w3.org/2001/10/synthesis' xml:lang='en-US'>" + "Go from <mark name=\"here\"/> here, to <mark name=\"there\"/> there!" + "</speak>"; // The media object for controlling and playing audio. MediaElement mediaElement = this.audio; mediaElement.MarkerReached += mediaElement_MarkerReached; // The object for controlling the speech synthesis engine (voice). var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer(); // Generate the audio stream from plain text. SpeechSynthesisStream stream = await synth.SynthesizeSsmlToStreamAsync(Ssml); // Send the stream to the media object. mediaElement.SetSource(stream, ""); mediaElement.Play();Can someone please tell what changes is need to make so that the mediaElement raises the markerReached event on <mark> tag in ssml.Any help would be highly appreciated. 解决方案 I don't see any samples that reference this so I am unsure if it is supported. I will see what I can find out for you! 这篇关于<标记>当由Windows Phone 8.1(rt)中的speechSyntheszer读取时ssml中的标记不会触发任何事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-30 01:18