开发者

How to see Microsoft Speech Recognition language and if it's active using Python?

开发者 https://www.devze.com 2022-12-29 11:19 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消