我想创建一个简单的程序,目的是让 Pepper 告诉我现在的时间或日期,当它识别我的演讲时,在我的情况下是“日期”或“时间”。我可以知道我应该如何在我的 TTS python 脚本中编码吗?
下面是我的 TTS python 盒子上的代码:
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
def onLoad(self):
#put initialization code here
from naoqi import ALProxy
self.tts = ALProxy("ALTextToSpeech")
pass
def onUnload(self):
#put clean-up code here
pass
def onInput_onStart(self):
#self.onStopped() #activate the output of the box
self.tts.say("Today is **#here i want to get input from GET DATE box#** ")
self.onStopped()
pass
def onInput_onStop(self):
self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
self.onStopped() #activate the output of the box
感谢大家的帮助。我是这里的初学者。