簡體   English   中英

Windows Phone 8的語音識別中是否設置了任何英語語法

[英]Is there any english language grammar set in Speech Recognition in Windows Phone 8

我正在使用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));

好吧,我不知道您要搜索的是什么,但這也許可以幫助您: http : //msicc.cloudapp.net/?p=3787

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM