catch Exception

This commit is contained in:
chrys 2017-05-09 22:39:10 +02:00
parent 90d28299e8
commit c351dbe00b

View File

@ -43,7 +43,8 @@ class driver():
if self.speechCommand == '': if self.speechCommand == '':
self.speechCommand = 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"' self.speechCommand = 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"'
if False: #for debugging overwrite here if False: #for debugging overwrite here
self.speechCommand = 'spd-say --wait -r 100 -i 100 "fenrirText"' #self.speechCommand = 'spd-say --wait -r 100 -i 100 "fenrirText"'
self.speechCommand = 'flite -t "fenrirText"'
self._isInitialized = True self._isInitialized = True
if self._isInitialized: if self._isInitialized:
@ -78,10 +79,13 @@ class driver():
if self.proc: if self.proc:
try: try:
self.proc.terminate() self.proc.terminate()
except: except Exception as e:
self.proc.kill() self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.terminate():' + str(e),debug.debugLevel.ERROR)
finally: try:
self.proc = None self.proc.kill()
except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.kill():' + str(e),debug.debugLevel.ERROR)
self.proc = None
self.lock.release() self.lock.release()
def setCallback(self, callback): def setCallback(self, callback):
print('SpeechDummyDriver: setCallback') print('SpeechDummyDriver: setCallback')