【发布时间】:2017-11-22 16:13:39
【问题描述】:
当我尝试使用以下代码从ALMemory 获取数据时:
session.service("ALMemory").done(function (ALMemory) {
var value = ALMemory.getData("ALTextToSpeech/TextDone");
});
这个value 的类型是AL::ALValue。我如何将其转换为 int,因为在这种情况下,当前正在讲话时预期为 0,当前未讲话时预期为 1。我试图用不同的方法将它转换为 int 或数字或字符串,但没有成功。
当我在 python SDK 中使用这个功能时:
def onLoad(self):
self.memory = ALProxy("ALMemory")
def onUnload(self):
self.memory = None
def onInput_checkIfSpeaking(self, p):
value = self.memory.getData("ALTextToSpeech/TextDone")
这个value 是int 类型,而不是AL::ALValue。这可以用 JavaScript 实现吗?
【问题讨论】:
标签: javascript python nao-robot pepper