fix espeak driver
This commit is contained in:
parent
72a739e099
commit
4060aee1a3
@ -23,8 +23,8 @@ settings = {
|
|||||||
'capitalPitch':0.8,
|
'capitalPitch':0.8,
|
||||||
'volume': 1.0,
|
'volume': 1.0,
|
||||||
'module': 'espeak',
|
'module': 'espeak',
|
||||||
'voice': 'en',
|
'voice': '',
|
||||||
'language': 'en',
|
'language': 'english-us',
|
||||||
'autoReadIncoming': True,
|
'autoReadIncoming': True,
|
||||||
},
|
},
|
||||||
'braille':{
|
'braille':{
|
||||||
|
@ -50,18 +50,20 @@ class driver():
|
|||||||
def setVoice(self, voice):
|
def setVoice(self, voice):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
|
if voice =='':
|
||||||
|
return False
|
||||||
return self._es.set_voice(voice)
|
return self._es.set_voice(voice)
|
||||||
|
|
||||||
def setPitch(self, pitch):
|
def setPitch(self, pitch):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
|
return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99))
|
||||||
|
|
||||||
def setRate(self, rate):
|
def setRate(self, rate):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
return self._es.set_parameter(self._es.Parameter().Rate, int(rate*450 + 80))
|
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):
|
def setModule(self, module):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
@ -69,6 +71,8 @@ class driver():
|
|||||||
def setLanguage(self, language):
|
def setLanguage(self, language):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
|
if language =='':
|
||||||
|
return False
|
||||||
return self._es.set_voice(language)
|
return self._es.set_voice(language)
|
||||||
|
|
||||||
def setVolume(self, volume):
|
def setVolume(self, volume):
|
||||||
|
Loading…
Reference in New Issue
Block a user