forked from platypush/platypush
detect_sound should support relative and ~ paths
This commit is contained in:
parent
8d660f27d4
commit
fe96940744
1 changed files with 4 additions and 1 deletions
|
@ -104,10 +104,13 @@ class AssistantSnowboyBackend(Backend):
|
||||||
raise AttributeError('Duplicate model key {}'.format(name))
|
raise AttributeError('Duplicate model key {}'.format(name))
|
||||||
|
|
||||||
model_file = conf.get('voice_model_file')
|
model_file = conf.get('voice_model_file')
|
||||||
|
detect_sound = conf.get('detect_sound')
|
||||||
|
|
||||||
if not model_file:
|
if not model_file:
|
||||||
raise AttributeError('No voice_model_file specified for model {}'.format(name))
|
raise AttributeError('No voice_model_file specified for model {}'.format(name))
|
||||||
|
|
||||||
model_file = os.path.abspath(os.path.expanduser(model_file))
|
model_file = os.path.abspath(os.path.expanduser(model_file))
|
||||||
|
detect_sound = os.path.abspath(os.path.expanduser(detect_sound))
|
||||||
assistant_plugin_name = conf.get('assistant_plugin')
|
assistant_plugin_name = conf.get('assistant_plugin')
|
||||||
|
|
||||||
if not os.path.isfile(model_file):
|
if not os.path.isfile(model_file):
|
||||||
|
@ -116,7 +119,7 @@ class AssistantSnowboyBackend(Backend):
|
||||||
self.models[name] = {
|
self.models[name] = {
|
||||||
'voice_model_file': model_file,
|
'voice_model_file': model_file,
|
||||||
'sensitivity': conf.get('sensitivity', 0.5),
|
'sensitivity': conf.get('sensitivity', 0.5),
|
||||||
'detect_sound': conf.get('detect_sound'),
|
'detect_sound': detect_sound,
|
||||||
'assistant_plugin': get_plugin(assistant_plugin_name) if assistant_plugin_name else None,
|
'assistant_plugin': get_plugin(assistant_plugin_name) if assistant_plugin_name else None,
|
||||||
'assistant_language': conf.get('assistant_language'),
|
'assistant_language': conf.get('assistant_language'),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue