How can i remove windows commands from pyspeech windows recognition? For example if i wanted for my program to open up notepad i would say "Open notepad", but then windows will also open up notepad for me too. How can i disable this so that my program is the only one running commands? Thank you

有帮助吗?

解决方案

You need to change PySpeech a bit.

Try changing

_recognizer = win32com.client.Dispatch("SAPI.SpSharedRecognizer")

to

_recognizer = win32com.client.Dispatch("SAPI.SpInprocRecognizer")

其他提示

Not sure if you're still looking for the answer or not but I found it for you!

On line 66 change the code to:

_recognizer = win32com.client.Dispatch("SAPI.SpInProcRecognizer")
_recognizer.AudioInputStream = win32com.client.Dispatch("SAPI.SpMMAudioIn")

And on line 112 change the code to:

_ListenerBase = win32com.client.getevents("SAPI.SpInProcRecoContext") 

This should prevent the windows commands from running while also not showing the widget which comes up. Good luck!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top