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

Commit 35e9a9b

Browse files
committed
fixed crash in Assistant handler
1 parent 654e7b8 commit 35e9a9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from alexapi.constants import RequestType, PlayerActivity
2828

2929
import pexpect
30+
global p
3031

3132
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s')
3233
coloredlogs.DEFAULT_FIELD_STYLES = {
@@ -341,7 +342,7 @@ def assistant_handler(voice_command):
341342
# compare to phrase_assistant from config
342343
voice_command_assistant = config['triggers']['pocketsphinx']['phrase_assistant']
343344
if voice_command == voice_command_assistant:
344-
345+
global p
345346
if p is not None:
346347
# SDK is ready, start recording
347348
logger.info('Starting Assistant conversation')
@@ -659,6 +660,7 @@ def cleanup(signal, frame): # pylint: disable=redefined-outer-name,unused-argu
659660
sys.exit(1)
660661

661662
### Start Assistant SDK
663+
global p
662664
p = start_assistant()
663665
###
664666

0 commit comments

Comments
 (0)