dont reinizialize on problems in set voice, rate, volume...

This commit is contained in:
chrys 2017-05-10 00:50:04 +02:00
parent 75fb8276ce
commit bbce7caba9

View File

@ -73,7 +73,6 @@ class driver():
self._sd.set_voice(voice) self._sd.set_voice(voice)
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver setVoice:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver setVoice:' + str(e),debug.debugLevel.ERROR)
self._isInitialized = False
def setPitch(self, pitch): def setPitch(self, pitch):
if not self._isInitialized: if not self._isInitialized:
@ -82,7 +81,6 @@ class driver():
self._sd.set_pitch(int(-100 + pitch * 200)) self._sd.set_pitch(int(-100 + pitch * 200))
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver setPitch:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver setPitch:' + str(e),debug.debugLevel.ERROR)
self._isInitialized = False
def setRate(self, rate): def setRate(self, rate):
if not self._isInitialized: if not self._isInitialized:
@ -91,7 +89,6 @@ class driver():
self._sd.set_rate(int(-100 + rate * 200)) self._sd.set_rate(int(-100 + rate * 200))
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver setRate:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver setRate:' + str(e),debug.debugLevel.ERROR)
self._isInitialized = False
def setModule(self, module): def setModule(self, module):
if not self._isInitialized: if not self._isInitialized:
@ -100,7 +97,6 @@ class driver():
self._sd.set_output_module(module) self._sd.set_output_module(module)
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver setModule:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver setModule:' + str(e),debug.debugLevel.ERROR)
self._isInitialized = False
def setLanguage(self, language): def setLanguage(self, language):
if not self._isInitialized: if not self._isInitialized:
@ -114,4 +110,3 @@ class driver():
self._sd.set_volume(int(-100 + volume * 200)) self._sd.set_volume(int(-100 + volume * 200))
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('speechDriver setVolume:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('speechDriver setVolume:' + str(e),debug.debugLevel.ERROR)
self._isInitialized = False