tweak speech drivers
This commit is contained in:
parent
b48bc02e6b
commit
5b3e5eecf6
@ -48,8 +48,9 @@ while(runtime['running']):
|
||||
if runtime['oldContentBytes'] != runtime['newContentBytes']:
|
||||
if len(runtime['delta']) < 3:
|
||||
runtime['speechDriver'].cancel()
|
||||
print(len(runtime['delta']))
|
||||
print("tty3 changed")
|
||||
|
||||
print(runtime['delta'])
|
||||
diff = difflib.ndiff(runtime['oldContentText'], runtime['newContentText'])
|
||||
runtime['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
||||
|
||||
|
@ -46,5 +46,9 @@ class speech():
|
||||
if not self.isInitialized:
|
||||
return False
|
||||
return es.set_parameter(espeak.Parameter.Rate, speed)
|
||||
|
||||
def setModule(self, module):
|
||||
pass
|
||||
|
||||
def shutdown(self):
|
||||
pass
|
||||
|
@ -59,6 +59,16 @@ class speech():
|
||||
except:
|
||||
return False
|
||||
|
||||
def setModule(self, module):
|
||||
if not self.isInitialized:
|
||||
return False
|
||||
try:
|
||||
self.sd..set_output_module(module)
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
def shutdown(self):
|
||||
self.cancel()
|
||||
self.sd.close()
|
||||
|
Loading…
Reference in New Issue
Block a user