Speech recognition in Windows Phone 8

Following This tutorial i am doing a sample program of speech recognition in WP8.I code like:

public async void SpeechToText_Click(object sender, RoutedEventArgs e)
{
  SpeechRecognizerUI speechRecognition=new SpeechRecognizerUI();
  SpeechRecognitionUIResult recoResult=await speechRecognition.RecognizeWithUIAsync();

if (recoResult.ResultStatus == SpeechRecognitionUIStatus.Succeeded)
  {
    MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
  }
}

After running the program,i always face a message " We're sorry but we can't access the network right now " said by a voice.
Does internet connection needed for it?I check my internet connection but it is good,so what's the problem there,can anyone explain?Is it a emulator problem or i am missing something?


Speech recognition requires access to Microsoft Cloud Services. Many people have problems getting their emulator to work well with internet enabled apps. Here's the MSDN article on troubleshooting that issue. If I were you I'd verify you can actually access the internet on the emulator using a simple WebBrowser and trying to navigate to a site of your choosing. If you aren't able to access an external site, voice recognition will not work on your emulator.


You might want to test voice recognition on the emulator as you would initiate it on a regular phone. Just click and hold the mouse button over the top of Windows button, at the bottom of the emulator.

On a freshly started emulator this should bring up a 'license agreement' & instructions for using voice commands, to which the user has to accept/decline the license agreement.

Then you can test the open ended voice recognition through the system, to see if it's something wrong in your app or on the phone/system.

It doesn't sound like this is your problem, but in my dealings with WP8's voice recognition, this 'first-run license message' can cause some problems with your app. That license notice will pop up even if you are not using the WP dialog for voice recognition. You particularly see this on the emulator, because every time you start it up, it's essentially a 'new phone', requiring the user to accept the license.


Check to make certain you have a reference to the AppResLib.dll file in your project. (For example if you are trying to localize the application) There is a known issue where this will generate the error message if a localized version of the Dll file cannot be found.

Here is the best link I know of to the issue:

http://dotnet-redzone.blogspot.com/2012/12/windows-phone-8speech-recognition.html

链接地址: http://www.djcxy.com/p/73540.html

上一篇: 是! 一个安全的方式来转换为C ++布尔?

下一篇: Windows Phone 8中的语音识别