Change to "save_utterances" instead of "record_utterances"
Change to match the documented and more intuitive name "save_utterances",
but add backwards compatibility code to support the original
"record_utterances".
@@ -188,7 +188,12 @@ class ResponsiveRecognizer(speech_recognition.Recognizer):
self.energy_ratio = listener_config.get('energy_ratio')
# check the config for the flag to save wake words.
- self.save_utterances = listener_config.get('record_utterances', False)
+ if 'record_utterances' in listener_config:
+ # TODO: 19.08 remove this backwards compatibility
+ self.save_utterances = listener_config.get('record_utterances')
+ else:
+ self.save_utterances = listener_config.get('save_utterances',
+ False)
self.upload_lock = Lock()
self.filenames_to_upload = []
self.mic_level_file = os.path.join(get_ipc_directory(), "mic_level")
