現在、Naturallylinkを使用しているDragon NaturallySpeakingからの入力を受け取り、処理し、音声出力を返すAIプログラムを作成しています。私は、Dragonからのすべての入力をキャプチャしてそれを私のパーサーに送るReceiver GrammarBaseを考え出すことができました。予想通りDragon NaturallySpeakingからのすべての入力をPythonにリダイレクトしますか? (Natlinkを使用)
class Receiver(GrammarBase):
gramSpec = """ <start> exported = {emptyList}; """
def initialize(self):
self.load(self.gramSpec, allResults = 1)
self.activateAll()
def gotResultsObject(self, recogType, resObj):
if recogType == 'reject':
inpt, self.best_guess = [], []
else:
inpt = extract_words(resObj)
inpt = process_input(inpt) # Forms a list of possible interpretations
self.best_guess = resObj.getWords(0)
self.send_input(inpt)
def send_input(self, inpt):
send = send_to_parser(inpt) # Sends first possible interpretation to parser
try:
while True:
send.next() # Sends the next possible interpretation if the first is rejected
except StopIteration: # If all interpretations are rejected, try sending the input to Dragon
try:
recognitionMimic(parse(self.best_guess))
except MimicFailed: # If that fails too, execute all_failed
all_failed()
このコードは動作しますが、いくつかの問題があります。
ドラゴンは私のプログラムに送信する前に入力を処理は。たとえば、「Google Chromeを開く」と言うと、Google Chromeを開き、入力をPythonに送信します。最初に処理しないで入力をPythonに送る方法はありますか?
私がwaitForSpeech()を呼び出すと、Pythonインタプリタが入力を待っていることを示すメッセージボックスがポップアップします。メッセージボックスが表示されないようにすることは可能ですか(美学と利便性のために)、代わりにユーザーからの大幅な一時停止後に音声収集プロセスを終了させることができますか?
ありがとうございます!
申し訳ありません。あなたの助けに感謝、歓声! – Jian
speechcomputing.comはGoogle向けに作られたようです。私が知る限り、それは有用なコンテンツの無効です。 – Harry
残念ながら、そのサイトはもはや維持されていません。代わりに、音声コーデックYahooグループを確認してください。 – reckoner