WIP emacspeakDriver
This commit is contained in:
parent
354aa30273
commit
7a4c52defe
@ -19,11 +19,12 @@ class driver(speechDriver):
|
|||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
try:
|
try:
|
||||||
self.server = ptyprocess.PtyProcessUnicode.spawn(['tclsh ', self.env['runtime']['settingsManager'].getSetting('speech', 'serverPath')])
|
self.server = ptyprocess.PtyProcessUnicode.spawn(['/usr/bin/tclsh', self.env['runtime']['settingsManager'].getSetting('speech', 'serverPath')])
|
||||||
#self.server = pexpect.spawnu('tclsh ' + self.env['runtime']['settingsManager'].getSetting('speech', 'serverPath'))
|
#self.server = pexpect.spawnu('tclsh ' + self.env['runtime']['settingsManager'].getSetting('speech', 'serverPath'))
|
||||||
|
self._isInitialized = True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['debug'].writeDebugOut('speechDriver:initialize:' + str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('speechDriver:initialize:' + str(e),debug.debugLevel.ERROR)
|
||||||
self._isInitialized = True
|
print(e)
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
if self.server:
|
if self.server:
|
||||||
@ -44,8 +45,9 @@ class driver(speechDriver):
|
|||||||
cleanText = cleanText.replace('"', '\"')
|
cleanText = cleanText.replace('"', '\"')
|
||||||
cleanText = cleanText.replace('\n', ' ')
|
cleanText = cleanText.replace('\n', ' ')
|
||||||
cleanText = cleanText.replace('[', '\[')
|
cleanText = cleanText.replace('[', '\[')
|
||||||
#print(text.replace('"', '\\\"'))
|
print(text.replace('"', '\\\"'))
|
||||||
self.server.write('tts_say ' + '"' + cleanText +'"\n')
|
self.server.write('tts_say ' + '"' + cleanText +'"\n')
|
||||||
|
print(self.server.read(1000))
|
||||||
#self.server.sendline('tts_say ' + '"' + cleanText +'"')
|
#self.server.sendline('tts_say ' + '"' + cleanText +'"')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['debug'].writeDebugOut('speechDriver:speak:self.server.sendline():' + str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('speechDriver:speak:self.server.sendline():' + str(e),debug.debugLevel.ERROR)
|
||||||
@ -55,8 +57,11 @@ class driver(speechDriver):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
self.server.write('s\n')
|
self.server.write('s\n')
|
||||||
|
print('drin')
|
||||||
|
print(self.server.read(1000))
|
||||||
#self.server.sendline('s')
|
#self.server.sendline('s')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
self.env['runtime']['debug'].writeDebugOut('speechDriver:cancel:self.server.sendline():' + str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('speechDriver:cancel:self.server.sendline():' + str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
def setRate(self, rate):
|
def setRate(self, rate):
|
||||||
|
Loading…
Reference in New Issue
Block a user