Beispiel #1
0
 def escuta(self,*args):
     if self.ids.mic.background_normal == 'mic.png':
         self.ids.mic.background_normal = ''
         stt.start()
         Clock.schedule_interval(self.checar,1/5)
     else:
         self.ids.mic.background_normal = 'mic.png'
         stt.stop()
Beispiel #2
0
    def start_listening(self):
        if stt.listening:
            self.stop_listening()
            return

        start_button = self.ids.start_button
        start_button.text = 'Stop'

        self.ids.results.text = ''
        self.ids.partial.text = ''

        stt.start()

        Clock.schedule_interval(self.check_state, 1 / 5)
    def voice_command(self):
        if(self.a==True):
            self.a=False
        else:
            self.a=True

        if(stt.exist()):
            if(self.a==True):   
              toast("listening speak")
              stt.start()
            elif(self.a==False):
             if(stt.listening==True):
              toast("stopped listening")#remove this wait till little
              stt.stop()
              self.result=stt.results
              logging.info(self.result)
              self.show_recognized_text()

        else:
            toast("your device doesnot support speech to text")
Beispiel #4
0
 def stt_start_listen(*args):
     if stt.listening:
         stt.stop_listening()
     stt.start()