From 7514744cdd726a346046869ee32ed4ace6bc3d4d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 2 Dec 2024 22:15:25 -0500 Subject: [PATCH] Removed the old espeak driver. There is still speech-dispatcher and generic. --- config/settings/settings.conf | 7 +-- .../speechDriver/espeakDriver.py | 58 ------------------- 2 files changed, 3 insertions(+), 62 deletions(-) delete mode 100644 src/fenrirscreenreader/speechDriver/espeakDriver.py diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 11e39939..642e5086 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -32,13 +32,12 @@ 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 or genericDriver: #driver=speechdDriver -#driver=espeakDriver driver=genericDriver # server path for emacspeak -serverPath=/home/chrys/Projekte/emacspeak/servers/espeak +# serverPath= # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest. rate=0.65 @@ -84,7 +83,7 @@ readNumbersAsDigits = False # fenrirRate = is replaced with the current speed (speech rate) genericSpeechCommand=espeak-ng -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText" -# those are the min and max values of the TTS system that is used in genericSpeechCommand +# min and max values of the TTS system that is used in genericSpeechCommand fenrirMinVolume=0 fenrirMaxVolume=200 fenrirMinPitch=0 diff --git a/src/fenrirscreenreader/speechDriver/espeakDriver.py b/src/fenrirscreenreader/speechDriver/espeakDriver.py deleted file mode 100644 index 49ea3509..00000000 --- a/src/fenrirscreenreader/speechDriver/espeakDriver.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# Fenrir TTY screen reader -# By Chrys, Storm Dragon, and contributers. -# Espeak driver - -from fenrirscreenreader.core import debug -from fenrirscreenreader.core.speechDriver import speechDriver - -class driver(speechDriver): - def __init__(self): - speechDriver.__init__(self) - self._es = None - - def initialize(self, environment): - self.env = environment - try: - from espeak import espeak - self._es = espeak - self._isInitialized = True - except Exception as e: - self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) - self._initialized = False - - def speak(self,text, interrupt=True): - if not self._isInitialized: - return - if not interrupt: - self.cancel() - if self.language != None: - if self.language != '': - self._es.set_voice(self.language) - elif self.voice != None: - if self.voice != '': - self._es.set_voice(self.voice) - self._es.synth(text) - - def cancel(self): - if not self._isInitialized: - return - self._es.cancel() - return - - def setPitch(self, pitch): - if not self._isInitialized: - return - return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99)) - - def setRate(self, rate): - if not self._isInitialized: - return - return self._es.set_parameter(self._es.Parameter().Rate, int(rate * 899 + 100)) - - def setVolume(self, volume): - if not self._isInitialized: - return - return self._es.set_parameter(self._es.Parameter().Volume, int(volume * 200))