Removed the old espeak driver. There is still speech-dispatcher and generic.

This commit is contained in:
Storm Dragon 2024-12-02 22:15:25 -05:00
parent d84edf520e
commit 7514744cdd
2 changed files with 3 additions and 62 deletions

View File

@ -32,13 +32,12 @@ genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine
# Turn speech on or off: # Turn speech on or off:
enabled=True enabled=True
# Select speech driver, options are speechdDriver (default), genericDriver or espeakDriver: # Select speech driver, options are speechdDriver or genericDriver:
#driver=speechdDriver #driver=speechdDriver
#driver=espeakDriver
driver=genericDriver driver=genericDriver
# server path for emacspeak # 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. # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest.
rate=0.65 rate=0.65
@ -84,7 +83,7 @@ readNumbersAsDigits = False
# fenrirRate = is replaced with the current speed (speech rate) # fenrirRate = is replaced with the current speed (speech rate)
genericSpeechCommand=espeak-ng -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText" 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 fenrirMinVolume=0
fenrirMaxVolume=200 fenrirMaxVolume=200
fenrirMinPitch=0 fenrirMinPitch=0

View File

@ -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))