Beispiel #1
0
    def __init__(self):

        espeak.synth("Hello Master!")

        self.rec = VoiceRecognizer()

        self.actions = ActionManager().loadActions()

        self.canHear = True
Beispiel #2
0
    def __init__(self):

        espeak.synth("Hello Master!")

        self.rec = VoiceRecognizer()

        self.actions = ActionManager().loadActions()

        # Variable used for command voice control, if True the voice command is executed
        self.canHear = True
Beispiel #3
0
                        key='slider')
          ], [button_subscribe, button_unsubscribe], [button_in, button_out],
          [sg.Button('Power off', font=('Helvetica', 20))],
          [sg.Button('Message', font=('Helvetica', 20))]]
window = sg.Window('Braze device', layout, size=(1000, 500))

device_id = 0
if len(sys.argv) > 1:
    device_id = sys.argv[1]
""" Setup """
mqtt_client = mqtt.Client()
main_driver = stmpy.Driver()
second_driver = stmpy.Driver()
device = Device(main_driver, second_driver, device_id)

voicerecognizer = VoiceRecognizer(main_driver)

main_driver.add_machine(device.stm)
# commend out the line under to disable voice recognizion
second_driver.add_machine(voicerecognizer.stm)


def application(main_driver, second_driver):
    # logging.DEBUG: Most fine-grained logging, printing everything
    # logging.INFO:  Only the most important informational log items
    # logging.WARN:  Show only warnings and errors.
    # logging.ERROR: Show only error messages.
    debug_level = logging.DEBUG
    logger = logging.getLogger(__name__)
    logger.setLevel(debug_level)
    ch = logging.StreamHandler()