From 4060aee1a3e5df4a839c05f08794a377c53eb16a Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 5 Nov 2016 14:51:55 +0100 Subject: [PATCH] fix espeak driver --- src/fenrir/core/settings.py | 4 ++-- src/fenrir/speechDriver/espeak.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index f4c6780a..6d092ad5 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -23,8 +23,8 @@ settings = { 'capitalPitch':0.8, 'volume': 1.0, 'module': 'espeak', - 'voice': 'en', - 'language': 'en', + 'voice': '', + 'language': 'english-us', 'autoReadIncoming': True, }, 'braille':{ diff --git a/src/fenrir/speechDriver/espeak.py b/src/fenrir/speechDriver/espeak.py index dd3c75ed..0bae1503 100644 --- a/src/fenrir/speechDriver/espeak.py +++ b/src/fenrir/speechDriver/espeak.py @@ -50,18 +50,20 @@ class driver(): def setVoice(self, voice): if not self._isInitialized: return False + if voice =='': + return False return self._es.set_voice(voice) def setPitch(self, pitch): if not self._isInitialized: return False - + return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99)) + def setRate(self, rate): if not self._isInitialized: return False return self._es.set_parameter(self._es.Parameter().Rate, int(rate*450 + 80)) - return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99)) def setModule(self, module): if not self._isInitialized: return False @@ -69,6 +71,8 @@ class driver(): def setLanguage(self, language): if not self._isInitialized: return False + if language =='': + return False return self._es.set_voice(language) def setVolume(self, volume):