add debut to speech-drivers

This commit is contained in:
chrys 2016-10-22 12:55:21 +02:00
parent 141377b7b8
commit 483fd21952
3 changed files with 13 additions and 7 deletions

View File

@ -34,7 +34,7 @@ class driver():
currScreen = self.env['screenData']['newTTY']
apps = subprocess.Popen('ps -t tty' + currScreen + ' -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
except Exception as e:
print(e)
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
return
try:
for i in apps:

View File

@ -11,14 +11,17 @@ class driver():
def __init__(self ):
self._es = None
self._isInitialized = False
def initialize(self, environment):
self.env = environment
try:
from espeak import espeak
self._es = espeak
self._isInitialized = True
except:
except Exception as e:
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
self._initialized = False
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass

View File

@ -12,15 +12,18 @@ class driver():
self._sd = None
self._isInitialized = False
self._language = ''
def initialize(self, environment):
self.env = environment
try:
import speechd
self._sd = speechd.SSIPClient('fenrir')
self._punct = speechd.PunctuationMode()
self._isInitialized = True
except:
except Exception as e:
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
self._initialized = False
def initialize(self, environment):
self.env = environment
def shutdown(self):
if not self._isInitialized:
return