문제

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