fix speechd driver dialect
This commit is contained in:
parent
3d5d048a4b
commit
85166bf552
@ -10,8 +10,8 @@ driver=speechd
|
|||||||
rate=0.75
|
rate=0.75
|
||||||
pitch=0.5
|
pitch=0.5
|
||||||
module=espeak
|
module=espeak
|
||||||
voice=us
|
voice=
|
||||||
language=en
|
language=english-us
|
||||||
volume=1.0
|
volume=1.0
|
||||||
autoReadIncomming=True
|
autoReadIncomming=True
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ class speech():
|
|||||||
def __init__(self ):
|
def __init__(self ):
|
||||||
self._sd = None
|
self._sd = None
|
||||||
self._isInitialized = False
|
self._isInitialized = False
|
||||||
|
self._language = ''
|
||||||
try:
|
try:
|
||||||
import speechd
|
import speechd
|
||||||
self._sd = speechd.SSIPClient('fenrir')
|
self._sd = speechd.SSIPClient('fenrir')
|
||||||
@ -18,6 +19,10 @@ class speech():
|
|||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
if queueable == False: self.cancel()
|
if queueable == False: self.cancel()
|
||||||
|
try:
|
||||||
|
self._sd.set_synthesis_voice(self._language)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self._sd.speak(text)
|
self._sd.speak(text)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -39,7 +44,8 @@ class speech():
|
|||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
self._sd.set_voice(voice)
|
if voice != '':
|
||||||
|
self._sd.set_voice(voice)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
@ -74,7 +80,7 @@ class speech():
|
|||||||
def setLanguage(self, language):
|
def setLanguage(self, language):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
return False
|
return False
|
||||||
self._sd.set_language(language)
|
self._language = language
|
||||||
|
|
||||||
def setVolume(self, volume):
|
def setVolume(self, volume):
|
||||||
if not self._isInitialized:
|
if not self._isInitialized:
|
||||||
|
Loading…
Reference in New Issue
Block a user