add volume

This commit is contained in:
chrys 2016-07-15 00:21:23 +02:00
parent 73338931bd
commit b81b35a6cf
5 changed files with 14 additions and 0 deletions

View File

@ -12,6 +12,7 @@ pitch=50
module=espeak
voice=de
language=de
volume=200
[braille]
enabled=False

View File

@ -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)

View File

@ -15,6 +15,8 @@ settings = {
'pitch': 1,
'module': '',
'voice': 'de',
'language': 'de',
'volume': 100
},
'braille':{
'enabled': False,

View File

@ -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

View File

@ -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