Added error/what handeling

fetchIP
E. Almqvist 4 years ago
parent 0b616bb2fc
commit 4a10874639
  1. 13
      speech_daemon.py

@ -34,16 +34,19 @@ class speech_daemon(object):
global CONFIG global CONFIG
CONFIG = cfg CONFIG = cfg
self.deviceIndex = CONFIG["speech"]["device_index"] self.deviceIndex = CONFIG["speech"]["device_index"] # Apply the device index
def start(self): def start(self):
controller.init() controller.init()
for inp in self.voiceInpObj.start( self.deviceIndex ): for inp in self.voiceInpObj.start( self.deviceIndex ):
cmdBuf = inp.lower().split(" ") if( inp != self.voiceInpObj.error and inp != self.voiceInpObj.what ):
if( cmdBuf[0] in CONFIG["speech"]["prefixes"] ): cmdBuf = inp.lower().split(" ")
print("CMD:", cmdBuf) if( cmdBuf[0] in CONFIG["speech"]["prefixes"] ):
parseCommandline( cmdBuf, False ) print("CMD:", cmdBuf)
parseCommandline( cmdBuf, False )
else:
print("Error/What: {0}".format(inp))
controller.end() controller.end()

Loading…
Cancel
Save