def stop_listening(self): start_button = self.ids.start_button start_button.text = 'Start Listening' stt.stop() self.update() Clock.unschedule(self.check_state)
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()
def checar(self,*args): if not stt.listening: self.ids.mic.background_normal = 'mic.png' stt.stop() Clock.unschedule(self.checar) frase = ''.join(stt.results) if frase: self.mensagem(frase)
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")
def stt_stop_listen(self, *args): stt.stop() self.update()