diff --git a/config/settings/settings.cfg b/config/settings/settings.cfg index 751ce2eb..be7e5bc0 100644 --- a/config/settings/settings.cfg +++ b/config/settings/settings.cfg @@ -12,6 +12,7 @@ pitch=50 module=espeak voice=de language=de +volume=200 [braille] enabled=False diff --git a/src/fenrir-package/core/outputManager.py b/src/fenrir-package/core/outputManager.py index d9fc7678..73c1633f 100644 --- a/src/fenrir-package/core/outputManager.py +++ b/src/fenrir-package/core/outputManager.py @@ -19,6 +19,7 @@ class outputManager(): environment['runtime']['speechDriver'].setPitch(environment['runtime']['settingsManager'].getSettingAsInt(environment, 'speech', 'pitch')) environment['runtime']['speechDriver'].setSpeed(environment['runtime']['settingsManager'].getSettingAsInt(environment, 'speech', 'rate')) environment['runtime']['speechDriver'].setModule(environment['runtime']['settingsManager'].getSetting(environment, 'speech', 'module')) + environment['runtime']['speechDriver'].setVolume(environment['runtime']['settingsManager'].getSettingAsInt(environment, 'speech', 'volume')) environment['runtime']['speechDriver'].speak(Text) diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index 43da3fb5..5f9dc820 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -15,6 +15,8 @@ settings = { 'pitch': 1, 'module': '', 'voice': 'de', + 'language': 'de', + 'volume': 100 }, 'braille':{ 'enabled': False, diff --git a/src/fenrir-package/speech/espeak.py b/src/fenrir-package/speech/espeak.py index a26b5830..1386d201 100644 --- a/src/fenrir-package/speech/espeak.py +++ b/src/fenrir-package/speech/espeak.py @@ -59,5 +59,10 @@ class speech(): return False return self._es.set_voice(language) + def setVolume(self, volume): + if not self._isInitialized: + return False + return self._es.set_parameter(self._es.Parameter().Volume, volume) + def shutdown(self): pass diff --git a/src/fenrir-package/speech/speechd.py b/src/fenrir-package/speech/speechd.py index be713392..7a7c7802 100644 --- a/src/fenrir-package/speech/speechd.py +++ b/src/fenrir-package/speech/speechd.py @@ -76,6 +76,11 @@ class speech(): return False self._sd.set_language(language) + def setVolume(self, volume): + if not self._isInitialized: + return False + self._sd.set_volume(volume) + def shutdown(self): if not self._isInitialized: return False