Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
fixed crash in Assistant handler
Browse files Browse the repository at this point in the history
  • Loading branch information
xtools-at committed May 15, 2017
1 parent 654e7b8 commit 35e9a9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from alexapi.constants import RequestType, PlayerActivity

import pexpect
global p

logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s')
coloredlogs.DEFAULT_FIELD_STYLES = {
Expand Down Expand Up @@ -341,7 +342,7 @@ def assistant_handler(voice_command):
# compare to phrase_assistant from config
voice_command_assistant = config['triggers']['pocketsphinx']['phrase_assistant']
if voice_command == voice_command_assistant:

global p
if p is not None:
# SDK is ready, start recording
logger.info('Starting Assistant conversation')
Expand Down Expand Up @@ -659,6 +660,7 @@ def cleanup(signal, frame): # pylint: disable=redefined-outer-name,unused-argu
sys.exit(1)

### Start Assistant SDK
global p
p = start_assistant()
###

Expand Down

0 comments on commit 35e9a9b

Please sign in to comment.