def run(sdk_conn):
'''The run method runs once the Cozmo SDK is connected.'''
robot = sdk_conn.wait_for_robot()
try:
print("Say something")
r = sr.Recognizer()
with sr.Microphone() as source:
while 1:
hear(source, r, robot)
print("say something else")
recognized = None
except KeyboardInterrupt:
print("")
print("Exit requested by user")
评论列表
文章目录