How to see Microsoft Speech Recognition language and if it's active using Python?
I'm using windows 7 english and I want to know how to see the microsoft speech language and to see if the speech recognition is active.
How can I do it using python?
Solved with:
x=_winreg.ConnectRegistry(None,_winreg.HKEY_CURRENT_USER)
try:
y= _winreg.OpenKey(x, r"Software\Microsoft\Speech\Preferences")
if _winreg.QueryValueEx(y,'en-开发者_如何学GoUS_CompletedSpeechConfiguration')[0]:
self.recognitionMode = True
else:
self.recognitionMode = False
except EnvironmentError:
self.recognitionMode = False
If you know the registry key you could use the Python _winreg API
精彩评论