return json.load(data_file) if __name__ == '__main__': # logging setup_logging() # read configs config = read_config_file('config.json') voice_itemname = config['voice_itemname'] openhab_baseurl = config['openhab_baseurl'] hotword = config['hotword'] # monitoring-health endpoint h = HealthCheck(config['health-port']) h.start() # Initialize the recognizer a = ToneGeneratorThread() r = CallbackCapablePorcupineRecognizer(lambda: a.ready(), lambda: a.confirm()) while (True): # Exception handling to handle # exceptions at the runtime try: # use the microphone as source for input. with Microphone( chunk_size=512, sample_rate=16000