Exemplo n.º 1
0
 def say_(self, cmd):
     """ Say command """
     result = eval(cmd, globals(), self.slots)
     MSG = "{}: {}".format(self.name, result)
     print(MSG)
     if self.client:
         data = {
             'msg': result,
             'spk': self.name,
             'webclient_sid': self.webclient_sid
         }
         self.client.emit('say', data, namespace="/cv")
     if self.tts:
         stop_listening()
         tts(result)
         start_listening()
     else:
         pass
Exemplo n.º 2
0
    def say_(self, cmd):
        """ Say command """

        result = eval(cmd, globals(), self.slots)
        if self.tts == 'google':
            stop_listening()
            tts_google(result)
            start_listening()
        elif self.tts == 'local':
            stop_listening()
            tts_local(result)
            start_listening()
        else:
            pass
        MSG = "{}: {}".format(self.name, result)
        if self.host:
            self.socket_state.emit('say', {"msg": MSG})
        else:
            print(MSG)