slackr31337 / PorcupinePipeline

Use Porcupine wake word to trigger a voice assistant pipeline in Home-Assistant
MIT License
30 stars 3 forks source link

always keep keywords and keyword_paths in sync #33

Closed chatziko closed 1 year ago

chatziko commented 1 year ago

When args.keyword_paths is set, args.keywords remains to its default value containing all porcupine default keywords. So the two arrays are not in sync, leading to incorectly printing the detected keyword in read_audio:

# this will print one of the default keywords, not the one we set!
_LOGGER.info("Detected keyword `%s`", keywords[result])

This small PR fixes this bug by ensuring that args.keyword_paths and args.keywords are in sync with each other (always generating the one from the other).