【问题标题】:How to check if Pepper is currently talking如何检查 Pepper 当前是否在说话
【发布时间】:2017-11-21 09:50:24
【问题描述】:

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

我正在寻找类似 @​​987654321@ 的东西,如果 Pepper 当前正在说话,则返回“True”,如果在方法调用时他没有说话,则返回“False”。

【问题讨论】:

    标签: python nao-robot pepper


    【解决方案1】:

    您可以订阅 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

    【讨论】:

      【解决方案2】:

      我也在寻找您描述的方法,但没有找到。 我做了一个解决方法,我检查扬声器是否正在播放。那就是说话,播放音乐等。

      # 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 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-12-16
        • 1970-01-01
        • 2020-03-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-06
        • 1970-01-01
        相关资源
        最近更新 更多