Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes #43

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ovos_plugin_manager/skills.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def load_skill_plugins(*args, **kwargs):
plugin_skills = []
plugins = find_skill_plugins()
for skill_id, plug in plugins.items():
skill = plug(*args, **kwargs)
try:
skill = plug(*args, **kwargs)
except:
LOG.exception(f"Failed to load {skill_id}")
continue
plugin_skills.append(skill)
return plugin_skills
3 changes: 2 additions & 1 deletion ovos_plugin_manager/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def get_stt_config(config=None):
lang = config.get("lang", "en-us")
if "stt" in config:
config = config["stt"]
stt_module = config.get('module', 'google')
stt_module = config.get('module', 'dummy')
stt_config = config.get(stt_module, {})
stt_config["lang"] = stt_config.get('lang') or lang
stt_config["module"] = stt_module
return stt_config
12 changes: 7 additions & 5 deletions ovos_plugin_manager/templates/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,17 @@ def load_phonemes(self, key):
return phoneme_file.load()

def stop(self):
try:
TTS.playback.stop()
except Exception as e:
pass
if TTS.playback:
try:
TTS.playback.stop()
except Exception as e:
pass
self.add_metric({"metric_type": "tts.stop"})

def shutdown(self):
self.stop()
TTS.playback.detach_tts(self)
if TTS.playback:
TTS.playback.detach_tts(self)

def __del__(self):
self.shutdown()
Expand Down
1 change: 1 addition & 0 deletions ovos_plugin_manager/vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ def get_vad_config(config=None):
config = config["VAD"]
vad_module = config.get('module') or 'dummy'
vad_config = config.get(vad_module, {})
vad_config["module"] = vad_module
return vad_config
5 changes: 2 additions & 3 deletions ovos_plugin_manager/wakewords.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ def get_class(hotword, config=None):

@staticmethod
def load_module(module, hotword, config, lang, loop):
LOG.info('Loading "{}" wake word via {}'.format(hotword, module))
LOG.info(f'Loading "{hotword}" wake word via {module}')
if module in OVOSWakeWordFactory.MAPPINGS:
module = OVOSWakeWordFactory.MAPPINGS[module]

clazz = load_wake_word_plugin(module)
if clazz is None:
raise ValueError(f'Wake Word plugin {module} not found')
LOG.info(
'Loaded the Wake Word plugin {}'.format(module))
LOG.info(f'Loaded the Wake Word plugin {module}')

return clazz(hotword, config, lang=lang)

Expand Down