|
|
|
@ -9,12 +9,13 @@
|
|
|
|
|
# Libraries
|
|
|
|
|
import re
|
|
|
|
|
from config import characters, directions
|
|
|
|
|
from logic import tts, read_script, select_script
|
|
|
|
|
from logic import tts, read_script, select_script, play_script
|
|
|
|
|
from subprocess import call
|
|
|
|
|
import paho.mqtt.client as mqtt
|
|
|
|
|
import json
|
|
|
|
|
from time import sleep
|
|
|
|
|
from pixel_ring import pixel_ring
|
|
|
|
|
import serial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# === SETUP OF MQTT PART 1 ===
|
|
|
|
@ -33,6 +34,8 @@ def on_connect(client, userdata, flags, rc):
|
|
|
|
|
client.subscribe("hermes/asr/textCaptured")
|
|
|
|
|
client.subscribe("hermes/dialogueManager/sessionQueued")
|
|
|
|
|
|
|
|
|
|
# Set up serial connection with the microcontroller that controls the speaker LED's
|
|
|
|
|
ser = serial.Serial('/dev/ttyACM0', 1000000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -43,20 +46,13 @@ def on_wakeword(client, userdata, msg):
|
|
|
|
|
|
|
|
|
|
# Function which is triggered when the intent introduction is activated
|
|
|
|
|
def on_play_intro(client,userdata,msg):
|
|
|
|
|
# # disable this intent to avoid playing another act triggered by the Google Home
|
|
|
|
|
# client.publish("hermes/dialogueManager/configure", json.dumps({
|
|
|
|
|
# 'siteId': 'default',
|
|
|
|
|
# 'intents': {
|
|
|
|
|
# 'jocavdh:play': False
|
|
|
|
|
# }
|
|
|
|
|
# }))
|
|
|
|
|
|
|
|
|
|
import pdb; pdb.set_trace()
|
|
|
|
|
path = 'scripts_play/intro/'
|
|
|
|
|
call(["python3", "act.py", 'scripts_play/intro/introduction_01.txt'])
|
|
|
|
|
#call(["python3", "act.py", 'scripts_play/intro/introduction_01.txt'])
|
|
|
|
|
play_script('scripts_play/intro/introduction_01.txt')
|
|
|
|
|
print('The act is over.')
|
|
|
|
|
|
|
|
|
|
#on_play_question(client, userdata, msg)
|
|
|
|
|
|
|
|
|
|
# Function which is triggered when the intent for another question is activated
|
|
|
|
|
def on_play_question(client, userdata, msg):
|
|
|
|
|
|
|
|
|
|