本文介绍了当我尝试将语言设置为SpeechRecognize(WP 8.1)时不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我尝试将语言设置为SpeechRecognize(Windows Phone 8.1)时,它会运行异常。但是在文档中告诉我按照我做D的方式进行操作;



这个有效:

   private   async  无效    Button_Click_1    object   sender      RoutedEventArgs   e    
{
var rec = SpeechRecognizer ();
await rec
CompileConstraintsAsync ();
rec
UIOptions AudiblePrompt = "Aguardando o comando" ;
var stream = await rec RecognizeWithUIAsync ();

}



这不起作用:

  私人  async  无效    Button_Click_1    object   sender      RoutedEventArgs   e    
{
var rec = SpeechRecognizer new Windows Globalization 语言 " pt -BR" ));
await rec
CompileConstraintsAsync ();
rec
UIOptions AudiblePrompt = "Aguardando o comando" ;
var stream = await rec RecognizeWithUIAsync ();

}



有人可以帮助我吗?

解决方案

When I try to set a language to SpeechRecognize (Windows Phone 8.1) it runs an exception. But in documentation tells me to do the way I'm doing D;

This works:

private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var rec = new SpeechRecognizer();
            await rec.CompileConstraintsAsync();
            rec.UIOptions.AudiblePrompt = "Aguardando o comando";
            var stream = await rec.RecognizeWithUIAsync();

        }

This doesn't work:

private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
             var rec = new SpeechRecognizer(new Windows.Globalization.Language("pt-BR"));
            await rec.CompileConstraintsAsync();
            rec.UIOptions.AudiblePrompt = "Aguardando o comando";
            var stream = await rec.RecognizeWithUIAsync();

        }

Someone PLEASE could help me ?

解决方案


这篇关于当我尝试将语言设置为SpeechRecognize(WP 8.1)时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 01:24