-1

I want to know how can I add commands to windows 7 shared speech recognition using SAPI 5.4 in C#. There is already a Microsoft application named WSRMacros, but I should do it programmatically by myself. Any help and explanation would be extremely appreciated.

1 Answers1

0

Just create an application that uses System.Speech.Recognizer.SpeechRecognizer. This loads the shared recognizer, which starts Windows Speech Recognition.

Create your grammars, and off you go!

Eric Brown
  • 13,774
  • 7
  • 30
  • 71
  • Thanks Eric, I was waiting for you to answer me. Actually I want to add the commands to widows speech recognition application in a way that even after I closed my application they would remain in windows speech application, so I think I need to do that with SpeechLib not System.Speech. and I don't want to replace the default grammmar by the new ones. So What do you think? By the way I know that this is my mistake that I couldn't clarify these things in my original question. – Jimmy Harford Apr 04 '14 at 00:13
  • Adding new commands to the shared recognizer won't replace the commands in the default grammar. But your application has to stay running (even in the background or in a system tile, but not as a service) for your commands to be recognized. – Eric Brown Apr 04 '14 at 20:11
  • Thanks for your help, I noticed that but I thought maybe there is another (hard) way to make them remain into the shared recognizer memory. – Jimmy Harford Apr 05 '14 at 02:18
  • @JimmyHarford Even if there *was* some way to make the grammars stick around, what would happen once your program had exited? – Eric Brown Apr 05 '14 at 06:42