try to reconnect to speechd

This commit is contained in:
chrys 2016-11-04 21:39:02 +01:00
parent 8e26484d3f
commit 643e755bd2

View File

@ -34,13 +34,15 @@ class driver():
def speak(self,text, queueable=True): def speak(self,text, queueable=True):
if not self._isInitialized: if not self._isInitialized:
return False self.initialize(self.env)
if not self._isInitialized:
return False
if queueable == False: self.cancel() if queueable == False: self.cancel()
try: try:
self._sd.set_synthesis_voice(self._language) self._sd.set_synthesis_voice(self._language)
self._sd.set_punctuation(self._punct.NONE) self._sd.set_punctuation(self._punct.NONE)
except Exception as e: except Exception as e:
pass self._isInitialized = False
self._sd.speak(text) self._sd.speak(text)
return True return True