add debug to speechd speech Driver
This commit is contained in:
parent
cebdadf54d
commit
75fb8276ce
@ -21,7 +21,7 @@ class driver():
|
|||||||
self._punct = speechd.PunctuationMode()
|
self._punct = speechd.PunctuationMode()
|
||||||
self._isInitialized = True
|
self._isInitialized = True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('speechDriver initialize:' + str(e),debug.debugLevel.ERROR)
|
||||||
self._initialized = False
|
self._initialized = False
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
@ -46,6 +46,7 @@ class driver():
|
|||||||
self._sd.set_punctuation(self._punct.NONE)
|
self._sd.set_punctuation(self._punct.NONE)
|
||||||
self._sd.speak(text)
|
self._sd.speak(text)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
self.env['runtime']['debug'].writeDebugOut('speechDriver speak:' + str(e),debug.debugLevel.ERROR)
|
||||||
self._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
@ -54,6 +55,7 @@ class driver():
|
|||||||
try:
|
try:
|
||||||
self._sd.cancel()
|
self._sd.cancel()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
self.env['runtime']['debug'].writeDebugOut('speechDriver cancel:' + str(e),debug.debugLevel.ERROR)
|
||||||
self._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
@ -70,6 +72,7 @@ class driver():
|
|||||||
if voice != '':
|
if voice != '':
|
||||||
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._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def setPitch(self, pitch):
|
def setPitch(self, pitch):
|
||||||
@ -78,6 +81,7 @@ class driver():
|
|||||||
try:
|
try:
|
||||||
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._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def setRate(self, rate):
|
def setRate(self, rate):
|
||||||
@ -86,6 +90,7 @@ class driver():
|
|||||||
try:
|
try:
|
||||||
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._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def setModule(self, module):
|
def setModule(self, module):
|
||||||
@ -94,6 +99,7 @@ class driver():
|
|||||||
try:
|
try:
|
||||||
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._isInitialized = False
|
self._isInitialized = False
|
||||||
|
|
||||||
def setLanguage(self, language):
|
def setLanguage(self, language):
|
||||||
@ -107,4 +113,5 @@ class driver():
|
|||||||
try:
|
try:
|
||||||
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._isInitialized = False
|
self._isInitialized = False
|
||||||
|
Loading…
Reference in New Issue
Block a user