From 3591a8967f3703cdc601ab8e29f8f9ab2079eb75 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Tue, 28 Nov 2023 16:18:23 -0800 Subject: [PATCH] Override ovos.language.stt handler for server/API usage --- neon_speech/service.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/neon_speech/service.py b/neon_speech/service.py index 9668532..92199a1 100644 --- a/neon_speech/service.py +++ b/neon_speech/service.py @@ -221,6 +221,16 @@ def register_event_handlers(self): self.bus.on("neon.enable_wake_word", self.handle_enable_wake_word) self.bus.on("neon.disable_wake_word", self.handle_disable_wake_word) + def _handle_get_languages_stt(self, message): + if self.config.get('listener', {}).get('enable_voice_loop', True): + return OVOSDinkumVoiceService._handle_get_languages_stt(self, + message) + # For server use, get the API STT langs + stt_langs = self.api_stt.available_languages or \ + [self.config.get('lang') or 'en-us'] + LOG.debug(f"Got stt_langs: {stt_langs}") + self.bus.emit(message.response({'langs': list(stt_langs)})) + def handle_disable_wake_word(self, message: Message): """ Disable a wake word. If the requested wake word is the only one enabled,