[英]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.