【发布时间】:2016-09-07 17:20:01
【问题描述】:
是否有可能以某种方式在 python 3.5 中使用文本转语音
import speech
import time
response = speech.input("Say something, please.")
speech.say("You said " + response)
def callback(phrase, listener):
if phrase == "goodbye":
listener.stoplistening()
speech.say(phrase)
listener = speech.listenforanything(callback)
while listener.islistening():
time.sleep(.5)
错误:
Traceback (most recent call last):
File "D:/project/prog_2.py", line 1, in <module>
import speech
File "C:\Users\User\AppData\Roaming\Python\Python35\site-packages\speech.py", line 157
print prompt
^
SyntaxError: Missing parentheses in call to 'print'
我对 gTTS 有疑问,也许这里有一些建议:
【问题讨论】:
标签: python-3.x speech-recognition speech