سؤال

I'm writing some speech recognition code in python and I want it to be able to turn on the microsoft speech recognition system, but I want that system to ignore all the regular gui interface commands. So that if I say something that it recognizes, it will ignore it and let my program handle it.

هل كانت مفيدة؟

المحلول

I believe there is a python API called pyspeech that is a wrapper around the Microsoft speech APIs. See pyspeech (python) - Transcribe mp3 files? for some answers that may be helpful.

Typically, with the Microsoft speech API when people see the "regular GUI interface commands" it means that they have instantiated a shared recognizer. You need to instantiate an inproc recognizer. You do this by instantiating a SpeechRecognitionEngine() in your application. See SpeechRecognitionEngine Class. I suspect you are instantiating a shared recognizer - SpeechRecognizer Class

There is a very good article about Microsoft Speech that was published a few years ago at http://msdn.microsoft.com/en-us/magazine/cc163663.aspx. It is probably the best introductory article I’ve found so far. It is a little out of date, but very helfpul. (The AppendResultKeyValue method was dropped after the beta.) 

These two questions may have some other good information for you:

  1. What is the difference between System.Speech.Recognition and Microsoft.Speech.Recognition?
  2. SAPI and Windows 7 Problem
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top