1
我是python的新手,並且一直在學習如何使用python語音識別「pygsr」和pyttsx,現在我想知道如何組合代碼以實現共同目標,即:當我與該計劃交談時,它會給我一個迴應。如何在python上結合語音識別和pyttsx 2.7
我使用Python 2.7 在Windows 8 和我已經安裝了語音識別和pyttsx庫
這是代碼pyttsx代碼
import pyttsx
engine = pyttsx.init()
engine.say ('Good morning.')
engine.runAndWait()
這是利用Python庫
語音識別代碼from pygsr import Pygsr
speech = Pygsr()
# duration in seconds
speech.record(3)
# select the language
phrase, complete_response = speech.s
print phrase
任何關於如何完成它的建議是可以接受的
謝謝