Skip to content

Commit

Permalink
Override ovos.language.stt handler for server/API usage (#185)
Browse files Browse the repository at this point in the history
# Description
Adds support for k8s deployments and other instances not running a voice
loop to query supported STT languages

# Issues
<!-- If this is related to or closes an issue/other PR, please note them
here -->

# Other Notes
<!-- Note any breaking changes, WIP changes, requests for input, etc.
here -->

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Nov 29, 2023
1 parent 1154859 commit 2e23c04
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 2e23c04

Please sign in to comment.