示例#1
0
    def in_started(self, message: Any, sender: RhasspyActor) -> None:
        """Handle messages in started state."""
        if isinstance(message, TranscribeWav):
            try:
                text, confidence = self.transcribe_wav(message.wav_data)
                self._logger.debug(text)
                self.send(
                    message.receiver or sender,
                    WavTranscription(text,
                                     confidence=confidence,
                                     handle=message.handle),
                )
            except Exception:
                self._logger.exception("transcribing wav")

                # Send empty transcription back
                self.send(
                    message.receiver or sender,
                    WavTranscription("", confidence=0, handle=message.handle),
                )
示例#2
0
 def in_started(self, message: Any, sender: RhasspyActor) -> None:
     """Handle messages in started state."""
     if isinstance(message, TranscribeWav):
         text = self.transcribe_wav(message.wav_data)
         self.send(message.receiver or sender, WavTranscription(text))
示例#3
0
 def in_started(self, message: Any, sender: RhasspyActor) -> None:
     """Handle messages in started state."""
     if isinstance(message, TranscribeWav):
         self.send(message.receiver or sender, WavTranscription(""))