如何在Python中订阅ALSpeechRecognition Naoqi事件 [英] How to subcribe an event of ALSpeechRecognition Naoqi in Python

查看:119
本文介绍了如何在Python中订阅ALSpeechRecognition Naoqi事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想订阅事件:Python中Nao的ALSpeechRecognition API naoqi的"SpeechDetected".有人知道如何使用吗? http://doc.aldebaran.com/2- 1/naoqi/audio/alspeechrecognition-api.html#SpeechDetected

Hi I want subcribe Event: "SpeechDetected" of ALSpeechRecognition API naoqi for Nao in python. Anyone know how to use this ?? http://doc.aldebaran.com/2-1/naoqi/audio/alspeechrecognition-api.html#SpeechDetected

推荐答案

为此,您需要创建一个python NAOqi模块, 然后使用subscribeToEvent(或subscribeToMicroEvent)注册到变量.

To do that, you need to create a python NAOqi module, then register to the variable using subscribeToEvent (or subscribeToMicroEvent).

您可以在这里看看: http://doc.aldebaran.com/2-1/naoqi/core/almemory-tuto.html#almemory-tuto

当心:由于作用域的限制,python变量的名称必须与您创建的模块名称相同,如以下行所示:

Beware: due to scoping the python variable must have the same name than the module name you create, as seen in this line:

pythonModule = myModule("pythonModule")

这篇关于如何在Python中订阅ALSpeechRecognition Naoqi事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆