From 4060aee1a3e5df4a839c05f08794a377c53eb16a Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 5 Nov 2016 14:51:55 +0100 Subject: [PATCH 1/2] fix espeak driver --- src/fenrir/core/settings.py | 4 ++-- src/fenrir/speechDriver/espeak.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index f4c6780a..6d092ad5 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -23,8 +23,8 @@ settings = { 'capitalPitch':0.8, 'volume': 1.0, 'module': 'espeak', - 'voice': 'en', - 'language': 'en', + 'voice': '', + 'language': 'english-us', 'autoReadIncoming': True, }, 'braille':{ diff --git a/src/fenrir/speechDriver/espeak.py b/src/fenrir/speechDriver/espeak.py index dd3c75ed..0bae1503 100644 --- a/src/fenrir/speechDriver/espeak.py +++ b/src/fenrir/speechDriver/espeak.py @@ -50,18 +50,20 @@ class driver(): def setVoice(self, voice): if not self._isInitialized: return False + if voice =='': + return False return self._es.set_voice(voice) def setPitch(self, pitch): if not self._isInitialized: return False - + return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99)) + def setRate(self, rate): if not self._isInitialized: return False return self._es.set_parameter(self._es.Parameter().Rate, int(rate*450 + 80)) - return self._es.set_parameter(self._es.Parameter().Pitch, int(pitch * 99)) def setModule(self, module): if not self._isInitialized: return False @@ -69,6 +71,8 @@ class driver(): def setLanguage(self, language): if not self._isInitialized: return False + if language =='': + return False return self._es.set_voice(language) def setVolume(self, volume): From 52457d3c98c58ee95c6ef33e6fe8cf9399308d4a Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 5 Nov 2016 17:07:21 +0100 Subject: [PATCH 2/2] add espeak settings template --- config/settings/espeak.settings.conf | 124 +++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 config/settings/espeak.settings.conf diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf new file mode 100644 index 00000000..e11f0a35 --- /dev/null +++ b/config/settings/espeak.settings.conf @@ -0,0 +1,124 @@ +[sound] +# Turn sound on or off: +enabled=True + +# Select the driver used to play sounds, choices are generic and gstreamer. +# Sox is the default. +driver=generic + +# Sound themes. This is the pack of sounds used for sound alerts. +# Sound packs may be located at /usr/share/sounds +# For system wide availability, or ~/.local/share/fenrir/sounds +# For the current user. +theme=default + +# Sound volume controls how loud the sounds for your chosen soundpack are. +# 0 is quietest, 1.0 is loudest. +volume=1.0 + +# shell commands for generic sound driver +# the folowing variable are substituded +# fenrirVolume = the current volume setting +# fenrirSoundFile = the soundfile for an soundicon +# fenrirFrequence = the frequence to play +# fenrirDuration = the duration of the frequence +# the following command is used for play a soundfile +genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile 2>/dev/null +#the following command is used for generating a frequence beep +genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence 2>/dev/null + +[speech] +# Turn speech on or off: +enabled=True + +# Select speech driver, options are speechd (default) or espeak: +#driver=speechd +driver=espeak + + +# The rate selects how fast fenrir will speak. Options range from 0, slowest, to 1.0, fastest. +rate=0.35 + +# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. +pitch=0.5 +# Pitch for capital letters +capitalPitch=0.9 + +# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. +volume=1.0 + +# Module is used for speech-dispatcher, to select the speech module you want to use. +# Consult speech-dispatcher's configuration and help ti find out which modules are available. +# The default is espeak. +module=espeak + +# Voice selects the varient you want to use, for example, f5 will use the female voice #5 in espeak, +# or if using the espeak module in speech-dispatcher. To find out which voices are available, consult the documentation provided with your chosen synthesizer. +voice=f3 + +# Select the language you want fenrir to use. +language=en_US + +# Read new text as it happens? +autoReadIncoming=True + +[braille] +#braille is not implemented yet +enabled=False +driver=brlapi +layout=en + +[screen] +driver=linux +encoding=UTF-8 +screenUpdateDelay=0.4 +suspendingScreen= +autodetectSuspendingScreen=True + +[keyboard] +driver=evdev +# filter input devices NOMICE, ALL or a DEVICE NAME +device=ALL +# gives fenrir exclusive access to the keyboard and let consume keystrokes. +grabDevices=True +ignoreShortcuts=False +# the current shortcut layout located in /etc/fenrir/keyboard +keyboardLayout=desktop +# echo chars while typing. +charEcho=True +## echo deleted chars +charDeleteEcho=True +# echo word after pressing space +wordEcho=True +# interrupt speech on any keypress +interruptOnKeyPress=True +# timeout for double tap in sec +doubleTapTimeout=0.2 + +[general] +debugLevel=0 +punctuationProfile=default +punctuationLevel=some +respectPunctuationPause=True +newLinePause=True +numberOfClipboards=10 +emoticons=True +# define the current fenrir key +fenrirKeys=KEY_KP0,KEY_META +scriptKey=KEY_COMPOSE +timeFormat=%H:%M:%P +dateFormat=%A, %B %d, %Y +autoSpellCheck=True +spellCheckLanguage=en_US +scriptPath=/usr/share/fenrir/scripts + +[focus] +cursor=True +highlight=False + +[promote] +enabled=True +inactiveTimeoutSec=120 +list= + +