如何检查 Pepper 当前是否在说话

How to check if Pepper is currently talking

有没有办法接收机器人当前是否在说话的信息。 我查看了 ALDialog 和 ALTextToSpeech API,但找不到任何有用的东西。

我正在寻找类似 ALDialog.isSpeaking() 的东西 returns '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 

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

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

更多详情:http://doc.aldebaran.com/2-1/naoqi/audio/altexttospeech-api.html#ALTextToSpeech/Status