transl8示例存在问题 [英] Problem with the transl8 example
问题描述
这是参考
的教程http://blogs.msdn.com/b/translation/p/windowsphone8.aspx?wa=wsignin1.0
我现在有运行我的dev的transl8示例电话和 成功翻译文字。 然而,当我点击"说话"时按钮抛出outOfBoundsException。 我怀疑它来自以下代码:
//查询说法语的语音。
IEnumerable< VoiceInformation> voices =来自InstalledVoices中的语音。所有
其中voice.Language == filterLanguage
选择语音;
//设置查询标识的语音。
speech.SetVoice(voices.ElementAt(0));
//用法语计算。
await speech.SpeakTextAsync(lblTranslatedText.Text);
我不知道InstalledVoices.all是什么。我的手机是否缺少某种语言安装?有没有人有线索?
谢谢,
Dean
.net Developer
你好Dean ,
我没有对该具体示例发表评论,但暗示您可以做什么:
Translator API返回它可以说的语言在GetLanguagesForSpeak()方法中。 Speak()方法返回字符串的音频文件。
HTH,
Chris Wendt
Microsoft Translator
This is in reference to the tutorial at http://blogs.msdn.com/b/translation/p/windowsphone8.aspx?wa=wsignin1.0
I now have the transl8 example running of my dev phone and successfully translating text. However when I hit the "speak" button an outOfBoundsException is thrown. I suspect it is from the following code:
// Query for a voice that speaks French. IEnumerable<VoiceInformation> voices = from voice in InstalledVoices.All where voice.Language == filterLanguage select voice; // Set the voice as identified by the query. speech.SetVoice(voices.ElementAt(0)); // Count in French. await speech.SpeakTextAsync(lblTranslatedText.Text);
I have no idea what InstalledVoices.all is. Is my phone missing some kind of language installs? does anyone have a clue?
thanks,
Dean
.net Developer
Hi Dean,
I have no comment on that specific example, but a hint of what you can do:
The Translator API returns the languages it can speak in the GetLanguagesForSpeak() method. The Speak() method returns an audio file of your string.
HTH,
Chris Wendt
Microsoft Translator
这篇关于transl8示例存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!