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 runtime['oldContentBytes'] != runtime['newContentBytes']:
|
||||||
if len(runtime['delta']) < 3:
|
if len(runtime['delta']) < 3:
|
||||||
runtime['speechDriver'].cancel()
|
runtime['speechDriver'].cancel()
|
||||||
|
print(len(runtime['delta']))
|
||||||
print("tty3 changed")
|
print("tty3 changed")
|
||||||
|
print(runtime['delta'])
|
||||||
diff = difflib.ndiff(runtime['oldContentText'], runtime['newContentText'])
|
diff = difflib.ndiff(runtime['oldContentText'], runtime['newContentText'])
|
||||||
runtime['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
runtime['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
||||||
|
|
||||||
|
@ -46,5 +46,9 @@ class speech():
|
|||||||
if not self.isInitialized:
|
if not self.isInitialized:
|
||||||
return False
|
return False
|
||||||
return es.set_parameter(espeak.Parameter.Rate, speed)
|
return es.set_parameter(espeak.Parameter.Rate, speed)
|
||||||
|
|
||||||
|
def setModule(self, module):
|
||||||
|
pass
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
|
@ -59,6 +59,16 @@ class speech():
|
|||||||
except:
|
except:
|
||||||
return False
|
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):
|
def shutdown(self):
|
||||||
self.cancel()
|
self.cancel()
|
||||||
self.sd.close()
|
self.sd.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user