Merge pull request #1909 from forslund/bugfix/shutdown-precise
Stop hotword engines when reloadingpull/1915/head
commit
d95071070f
|
@ -61,6 +61,14 @@ class HotWordEngine(object):
|
|||
def update(self, chunk):
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
""" Perform any actions needed to shut down the hot word engine.
|
||||
|
||||
This may include things such as unload loaded data or shutdown
|
||||
external processess.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class PocketsphinxHotWord(HotWordEngine):
|
||||
def __init__(self, key_phrase="hey mycroft", config=None, lang="en-us"):
|
||||
|
@ -222,6 +230,10 @@ class PreciseHotword(HotWordEngine):
|
|||
return True
|
||||
return False
|
||||
|
||||
def stop(self):
|
||||
if self.runner:
|
||||
self.runner.stop()
|
||||
|
||||
|
||||
class SnowboyHotWord(HotWordEngine):
|
||||
def __init__(self, key_phrase="hey mycroft", config=None, lang="en-us"):
|
||||
|
|
|
@ -344,6 +344,7 @@ class RecognizerLoop(EventEmitter):
|
|||
Reload configuration and restart consumer and producer
|
||||
"""
|
||||
self.stop()
|
||||
self.wakeword_recognizer.stop()
|
||||
# load config
|
||||
self._load_config()
|
||||
# restart
|
||||
|
|
Loading…
Reference in New Issue