Dragon Naturally Speaking 14、トンボ、最新の natlink (4.1 または何か)、pywin32、python 2.7、および wxpython がインストールされています。
natlinkによって設定された「ユーザー構成ディレクトリ」に、これを含むpythonファイルがあります
Dragon Naturally Speaking が起動すると、natlink ポップアップ メッセージが表示され、動作していることがわかります。DNS 14 をリセットして、「マクロ」(dosomething.py) が確実に読み込まれるようにします。
これは私のdosomething.pyのコードです
from dragonfly import Grammar, CompoundRule
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
spec = "do something computer" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Voice command spoken."
# Create a grammar which contains and loads the command rule.
grammar = Grammar("example grammar") # Create a grammar to contain the command rule.
grammar.add_rule(ExampleRule()) # Add the command rule to the grammar.
grammar.load() # Load the grammar.
while True:
pythoncom.PumpWaitingMessages()
sleep(.1)
ただし、DNS を起動して有効にし、ディクテーションとコマンド モード、またはコマンド モードで「何かコンピューターを実行してください」と言うと、文字起こしボックスがポップアップ表示されます。そうではないと思います。何が起こるはずですか?私はPythonを初めて使用します.cmdウィンドウでインタープリターを起動しましたが、「音声コマンドが話されました」などのプロンプトは表示されませんでした。音声コマンドを言うと生成されます。それは起こるべきことですか?