Skip to content

Commit

Permalink
Override ovos.language.stt handler for server/API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 29, 2023
1 parent 1154859 commit 3591a89
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3591a89

Please sign in to comment.