Compare commits

..

2 Commits

Author SHA1 Message Date
Storm Dragon
7514744cdd Removed the old espeak driver. There is still speech-dispatcher and generic. 2024-12-02 22:15:25 -05:00
Storm Dragon
d84edf520e Renamed 'docu' directory to 'docs' 2024-12-02 21:18:56 -05:00
10 changed files with 4 additions and 63 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

@ -44,7 +44,7 @@ destDir = '/usr/share/sounds/fenrirscreenreader/template'
data_files.append((destDir, files)) data_files.append((destDir, files))
files = glob.glob('tools/*') files = glob.glob('tools/*')
data_files.append(('/usr/share/fenrirscreenreader/tools', files)) data_files.append(('/usr/share/fenrirscreenreader/tools', files))
data_files.append(('/usr/share/man/man1', ['docu/fenrir.1'])) data_files.append(('/usr/share/man/man1', ['docs/fenrir.1']))
def read(fname): def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()

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