|
|
@ -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 ): |
|
|
|
|
|
|
|
if( inp != self.voiceInpObj.error and inp != self.voiceInpObj.what ): |
|
|
|
cmdBuf = inp.lower().split(" ") |
|
|
|
cmdBuf = inp.lower().split(" ") |
|
|
|
if( cmdBuf[0] in CONFIG["speech"]["prefixes"] ): |
|
|
|
if( cmdBuf[0] in CONFIG["speech"]["prefixes"] ): |
|
|
|
print("CMD:", cmdBuf) |
|
|
|
print("CMD:", cmdBuf) |
|
|
|
parseCommandline( cmdBuf, False ) |
|
|
|
parseCommandline( cmdBuf, False ) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
print("Error/What: {0}".format(inp)) |
|
|
|
|
|
|
|
|
|
|
|
controller.end() |
|
|
|
controller.end() |
|
|
|
|
|
|
|
|
|
|
|