diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf index cda22e19..f2cae1b2 100644 --- a/config/settings/espeak.settings.conf +++ b/config/settings/espeak.settings.conf @@ -36,6 +36,8 @@ enabled=True #driver=genericDriver driver=espeakDriver +# server path for emacspeak +serverPath= # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest. rate=0.35 diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 87e496cc..29ea299f 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -37,6 +37,8 @@ driver=speechdDriver #driver=espeakDriver #driver=genericDriver +# server path for emacspeak +serverPath=/home/chrys/Projekte/emacspeak/servers/espeak # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest. rate=0.65 diff --git a/config/settings/settings.conf.example b/config/settings/settings.conf.example index 87e496cc..47244b32 100644 --- a/config/settings/settings.conf.example +++ b/config/settings/settings.conf.example @@ -32,11 +32,14 @@ genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine # Turn speech on or off: enabled=True -# Select speech driver, options are speechdDriver (default), genericDriver or espeakDriver: +# Select speech driver, options are speechdDriver (default), genericDriver, emacspeak or espeakDriver: driver=speechdDriver #driver=espeakDriver #driver=genericDriver +#driver=emacspeakDriver +# server path for emacspeak +serverPath=/home/chrys/Projekte/emacspeak/servers/espeak # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest. rate=0.65 diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index ba1e7a24..a51ca8e7 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -11,6 +11,7 @@ genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine enabled=True driver=speechdDriver #driver=genericDriver +serverPath= rate=0.95 pitch=0.5 # Pitch for capital letters diff --git a/src/fenrir/speechDriver/emacspeakDriver.py b/src/fenrir/speechDriver/emacspeakDriver.py index f41b3b03..b21e4c15 100644 --- a/src/fenrir/speechDriver/emacspeakDriver.py +++ b/src/fenrir/speechDriver/emacspeakDriver.py @@ -15,12 +15,12 @@ class driver(): pass def initialize(self, environment): self._isInitialized = False + self.env = environment try: - self.server = pexpect.spawnu('tclsh /home/chrys/Projekte/emacspeak/servers/espeak') + self.server = pexpect.spawnu('tclsh +' self.env['runtime']['settingsManager'].getSetting('speech', 'serverPath')) except Exception as e: self.env['runtime']['debug'].writeDebugOut('speechDriver:initialize:' + str(e),debug.debugLevel.ERROR) self._isInitialized = True - self.env = environment def shutdown(self): if self.server: @@ -40,6 +40,7 @@ class driver(): #self.server.sendline('tts_say ' + '\"' + text.replace('"', '\\\"') +'\"') except Exception as e: self.env['runtime']['debug'].writeDebugOut('speechDriver:speak:self.server.sendline():' + str(e),debug.debugLevel.ERROR) + def cancel(self): if not self._isInitialized: return @@ -47,8 +48,9 @@ class driver(): self.server.sendline('s') except Exception as e: self.env['runtime']['debug'].writeDebugOut('speechDriver:cancel:self.server.sendline():' + str(e),debug.debugLevel.ERROR) + def setCallback(self, callback): - print('SpeechDummyDriver: setCallback') + pass def clear_buffer(self): if not self._isInitialized: @@ -57,7 +59,6 @@ class driver(): def setVoice(self, voice): if not self._isInitialized: return - #self.server.sendline('s') def setPitch(self, pitch): pass @@ -69,9 +70,9 @@ class driver(): self.server.sendline('tts_set_speech_rate' + str(int(rate * 500))) except Exception as e: self.env['runtime']['debug'].writeDebugOut('speechDriver:setRate:self.server.sendline():' + str(e),debug.debugLevel.ERROR) + def setModule(self, module): pass - def setLanguage(self, language): if not self._isInitialized: return