add pause to punctuation
This commit is contained in:
@ -13,10 +13,13 @@ class punctuationManager():
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§"), ' ')
|
||||
# replace with space:
|
||||
# dot, comma, grave, apostrophe
|
||||
for char in [ord('.'),ord(','),ord('`'),ord("'")]:
|
||||
# replace with None:
|
||||
# grave, apostrophe
|
||||
for char in [ord('`'),ord("'")]:
|
||||
self.allPunctNone[char] = None
|
||||
# dont translate dot and comma because they create a pause
|
||||
for char in [ord('.'),ord(',')]:
|
||||
del self.allPunctNone[char]
|
||||
|
||||
def shutdown(self):
|
||||
pass
|
||||
|
@ -15,6 +15,7 @@ class driver():
|
||||
try:
|
||||
import speechd
|
||||
self._sd = speechd.SSIPClient('fenrir')
|
||||
self._punct = speechd.PunctuationMode()
|
||||
self._isInitialized = True
|
||||
except:
|
||||
self._initialized = False
|
||||
@ -34,6 +35,7 @@ class driver():
|
||||
if queueable == False: self.cancel()
|
||||
try:
|
||||
self._sd.set_synthesis_voice(self._language)
|
||||
self._sd.set_punctuation(self._punct.NONE)
|
||||
except:
|
||||
pass
|
||||
self._sd.speak(text)
|
||||
|
Reference in New Issue
Block a user