Skip to content

Commit

Permalink
Merge pull request #353 from webworxshop/fix-python-multiple-callbacks
Browse files Browse the repository at this point in the history
Fix issue with multiple callbacks not being called.
  • Loading branch information
chenguoguo authored Jan 25, 2018
2 parents 6504f94 + 74ec466 commit 06c81ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/Python/snowboydecoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion examples/Python3/snowboydecoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 06c81ad

Please sign in to comment.