diff --git a/examples/Python/snowboydecoder.py b/examples/Python/snowboydecoder.py index 8bd1f3a2..2ddb5949 100644 --- a/examples/Python/snowboydecoder.py +++ b/examples/Python/snowboydecoder.py @@ -188,7 +188,7 @@ def start(self, detected_callback=play_audio_file, message += time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) logger.info(message) - callback = detected_callback[0] + callback = detected_callback[status-1] if callback is not None: callback() diff --git a/examples/Python3/snowboydecoder.py b/examples/Python3/snowboydecoder.py index b0aa270d..75607a60 100644 --- a/examples/Python3/snowboydecoder.py +++ b/examples/Python3/snowboydecoder.py @@ -192,7 +192,7 @@ def audio_callback(in_data, frame_count, time_info, status): message += time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) logger.info(message) - callback = detected_callback[0] + callback = detected_callback[status-1] if callback is not None: callback()