2

I have a one problem in my program. I Want to convert speech to text and I have a this code:

Choices sList = new Choices();
sList.Add(new string[] { "hello" });
Grammar gr = new Grammar(new GrammarBuilder(sList));
try {
    sRecognize.RequestRecognizerUpdate();
    sRecognize.LoadGrammar(gr);
    sRecognize.SpeechRecognized += sRecognize_SpeechRecognized;
    sRecognize.SetInputToDefaultAudioDevice();
    sRecognize.RecognizeAsync(RecognizeMode.Multiple);
    sRecognize.Recognize();
}
catch (Exception ex) {
    MessageBox.Show(ex.Message.ToString());
}

But when I using it, Visual Studio give an exception "platformnotsupportedexception" And say "The recognizer is not installed." I have a microphone, But I don't know why this don't job. Please Help Me.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87

2 Answers2

0

platformnotsupportedexception The exception that is thrown when a feature does not run on a particular platform. This means that you probably didn't install Microsoft Speech Platform SDK 11 Requirements and Installation. Found here: http://msdn.microsoft.com/en-us/library/hh362873.aspx

Jeroen van Langen
  • 21,446
  • 3
  • 42
  • 57
0

Are you using System.Speech.Recognition or Microsoft.Speech.Recognition? They're different. If you're using Speech Platform Runtime/SDK 11, then you need to be using Microsoft.Speech.Recognition.

Also, you probably need to specify a cultureinfo when creating your recognizer.

Community
  • 1
  • 1
Eric Brown
  • 13,774
  • 7
  • 30
  • 71
  • using System.Speech.Recognition; – user2800980 Sep 21 '13 at 08:27
  • There are some additional framework or library that you can use to implement speech to text? – user2800980 Sep 21 '13 at 09:13
  • @user2800980 - You mentioned Speech Platform Runtime 11 and Speech Platform SDK 11 - those are server recognizers that require the use of Microsoft.Speech.Recognition. – Eric Brown Sep 21 '13 at 16:23
  • Microsoft. don't have a speech – user2800980 Sep 21 '13 at 18:13
  • @user2800980 - I have no idea what you mean. – Eric Brown Sep 21 '13 at 18:42
  • @user2800980 - Add it as a reference; assuming you installed the Speech Platform SDK 11 in the default location, go to Solution Explorer, right click References; click Add Reference; click Browse (near the bottom); navigate to c:\Program Files\Microsoft SDKs\Speech\V11.0\Assembly; select Microsoft.Speech.dll. – Eric Brown Sep 21 '13 at 23:20