From 75fb8276ce9f3c5345ef1ea52362e1b614f6c6f0 Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 9 May 2017 23:38:06 +0200 Subject: [PATCH] add debug to speechd speech Driver --- src/fenrir/speechDriver/speechdDriver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fenrir/speechDriver/speechdDriver.py b/src/fenrir/speechDriver/speechdDriver.py index 8e147d14..ab4081a1 100644 --- a/src/fenrir/speechDriver/speechdDriver.py +++ b/src/fenrir/speechDriver/speechdDriver.py @@ -21,7 +21,7 @@ class driver(): self._punct = speechd.PunctuationMode() self._isInitialized = True 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 def shutdown(self): @@ -46,6 +46,7 @@ class driver(): self._sd.set_punctuation(self._punct.NONE) self._sd.speak(text) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver speak:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def cancel(self): @@ -54,6 +55,7 @@ class driver(): try: self._sd.cancel() except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver cancel:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def setCallback(self, callback): @@ -70,6 +72,7 @@ class driver(): if voice != '': self._sd.set_voice(voice) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver setVoice:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def setPitch(self, pitch): @@ -78,6 +81,7 @@ class driver(): try: self._sd.set_pitch(int(-100 + pitch * 200)) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver setPitch:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def setRate(self, rate): @@ -86,6 +90,7 @@ class driver(): try: self._sd.set_rate(int(-100 + rate * 200)) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver setRate:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def setModule(self, module): @@ -94,6 +99,7 @@ class driver(): try: self._sd.set_output_module(module) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver setModule:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False def setLanguage(self, language): @@ -107,4 +113,5 @@ class driver(): try: self._sd.set_volume(int(-100 + volume * 200)) except Exception as e: + self.env['runtime']['debug'].writeDebugOut('speechDriver setVolume:' + str(e),debug.debugLevel.ERROR) self._isInitialized = False