Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows Phone 8的语音识别中是否设置了英语语法_C#_Visual Studio 2012_Windows Phone 8_Speech Recognition - Fatal编程技术网

C# Windows Phone 8的语音识别中是否设置了英语语法

C# Windows Phone 8的语音识别中是否设置了英语语法,c#,visual-studio-2012,windows-phone-8,speech-recognition,C#,Visual Studio 2012,Windows Phone 8,Speech Recognition,我正在使用c#/xaml开发Windows Phone 8应用程序。 我基本上是在尝试将语音转换成文本,并将其存储在文本框中。 语音输入将为普通英语。 但我想我需要创建整个语法文件。 有没有现成的东西,或者我遗漏了什么。 请帮忙 private async void record_Click(object sender, EventArgs e) { // Begin recognition using the default grammar and store the

我正在使用c#/xaml开发Windows Phone 8应用程序。 我基本上是在尝试将语音转换成文本,并将其存储在文本框中。 语音输入将为普通英语。 但我想我需要创建整个语法文件。 有没有现成的东西,或者我遗漏了什么。 请帮忙

private async void record_Click(object sender, EventArgs e)
    {
        // Begin recognition using the default grammar and store the result.
        SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();
        recoWithUI.Recognizer.Grammars.AddGrammarFromPredefinedType("message", SpeechPredefinedGrammar.Dictation);
        await this.recoWithUI.Recognizer.PreloadGrammarsAsync(); 

        // Check that a result was obtained
        if (recoResult.RecognitionResult != null)
        {
            // Determine if the user wants to save the note.
            var result = MessageBox.Show(string.Format("Heard you say \"{0}\" Save?", recoResult.RecognitionResult.Text), "Confirmation", MessageBoxButton.OKCancel);

            // Save the result to the Azure Mobile Service DB if the user is satisfied.
            if (result == MessageBoxResult.OK)
            {
                voicetext.Text = recoResult.RecognitionResult.Text;
            }
        }
    }

嗯,我不知道你在搜索什么,但也许这对你有帮助:

如果你不知道,你会得到预定义的短信听写语法

  // Load the pre-defined dictation grammar by default
  // and start recognition.
  SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();

  // Do something with the recognition result
  MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));

您好,在上面的链接中,我们必须添加语法,以便在说出特定单词时,执行命令…我不希望这样…我只想将用户所说的一切输入文本框…然后Eric Brown的答案是您的解决方案:)