Python 如何检查Pepper是否正在讲话

Python 如何检查Pepper是否正在讲话,python,nao-robot,pepper,Python,Nao Robot,Pepper,如果机器人当前正在说话或不说话,是否有接收信息的方法。 我查看了ALDialog和AltextToSpeechAPI,但没有找到任何有用的东西 我正在寻找类似ALDialog.isSpeaking()的方法,如果Pepper当前正在说什么,则返回“True”;如果Pepper在方法调用时没有说话,则返回“False”。我也在寻找类似您描述的方法,但没有找到任何方法。 我做了一个变通办法,检查扬声器是否正在播放。那将是演讲、演奏音乐等 # initialize self.boolSpeakersP

如果机器人当前正在说话或不说话,是否有接收信息的方法。 我查看了ALDialog和AltextToSpeechAPI,但没有找到任何有用的东西


我正在寻找类似
ALDialog.isSpeaking()
的方法,如果Pepper当前正在说什么,则返回“True”;如果Pepper在方法调用时没有说话,则返回“False”。

我也在寻找类似您描述的方法,但没有找到任何方法。 我做了一个变通办法,检查扬声器是否正在播放。那将是演讲、演奏音乐等

# initialize
self.boolSpeakersPlaying = True
self.audioDevice = self.session.service("ALAudioDevice")
self.signalID = self.audioDevice.speakersPlaying.connect(self.signalReceived)

#main
def signalReceived(self, arg):
self.logger.info("signal changed to = " + str(arg))
self.boolSpeakersPlaying = arg

def spam(self):
if not self.boolSpeakersPlaying:
    #do something 

我也在寻找一种你描述的方法,但没有找到。 我做了一个变通办法,检查扬声器是否正在播放。那将是演讲、演奏音乐等

# initialize
self.boolSpeakersPlaying = True
self.audioDevice = self.session.service("ALAudioDevice")
self.signalID = self.audioDevice.speakersPlaying.connect(self.signalReceived)

#main
def signalReceived(self, arg):
self.logger.info("signal changed to = " + str(arg))
self.boolSpeakersPlaying = arg

def spam(self):
if not self.boolSpeakersPlaying:
    #do something 

ALMemory上有各种各样的信息,你可以订阅这些信息,给你关于说话的信息,甚至更准确地说:现在说的是哪个词

JVoyage [0] ~ $ qicli call ALMemory.getDataList ALTextToSpeech
["ALTextToSpeech/CurrentSentence","ALTextToSpeech/PositionOfCurrentWord",
"ALTextToSpeech/CurrentBookMark","ALTextToSpeech/TextStarted","ALTextToSpeech/TextDone",
"ALTextToSpeech/Status","ALTextToSpeech/CurrentWord","ALTextToSpeech/TextInterrupted"]

更多详细信息:

在ALMemory中发布了各种信息,您可以订阅这些信息,为您提供有关讲话的信息,甚至更准确地说:当前讲的是哪个词

JVoyage [0] ~ $ qicli call ALMemory.getDataList ALTextToSpeech
["ALTextToSpeech/CurrentSentence","ALTextToSpeech/PositionOfCurrentWord",
"ALTextToSpeech/CurrentBookMark","ALTextToSpeech/TextStarted","ALTextToSpeech/TextDone",
"ALTextToSpeech/Status","ALTextToSpeech/CurrentWord","ALTextToSpeech/TextInterrupted"]
更多详情: