diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index e84b1cc2..5430a01e 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -10,8 +10,8 @@ driver=speechd rate=0.75 pitch=0.5 module=espeak -voice=us -language=en +voice= +language=english-us volume=1.0 autoReadIncomming=True diff --git a/src/fenrir-package/speech/speechd.py b/src/fenrir-package/speech/speechd.py index d1ed470e..6fe56c7b 100644 --- a/src/fenrir-package/speech/speechd.py +++ b/src/fenrir-package/speech/speechd.py @@ -6,6 +6,7 @@ class speech(): def __init__(self ): self._sd = None self._isInitialized = False + self._language = '' try: import speechd self._sd = speechd.SSIPClient('fenrir') @@ -18,6 +19,10 @@ class speech(): if not self._isInitialized: return False if queueable == False: self.cancel() + try: + self._sd.set_synthesis_voice(self._language) + except: + pass self._sd.speak(text) return True @@ -39,7 +44,8 @@ class speech(): if not self._isInitialized: return False try: - self._sd.set_voice(voice) + if voice != '': + self._sd.set_voice(voice) return True except: return False @@ -74,7 +80,7 @@ class speech(): def setLanguage(self, language): if not self._isInitialized: return False - self._sd.set_language(language) + self._language = language def setVolume(self, volume): if not self._isInitialized: