diff --git a/TODO b/TODO index 903523fc..3bb0f11b 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,7 @@ ToDos in Priority order: curr item first item last item -- beep on cursor to capital letters in cursor and review + - implement onScreenUpdate commands read highlighted text mode - add the debugging to core @@ -222,3 +222,4 @@ ps a -o tty,comm | grep -e Xorg | grep -v "grep -e Xorg" - dictonary for special chars and string replacements - punctuation +- beep on cursor to capital letters in cursor and review diff --git a/config/settings/settings.conf b/config/settings/settings.conf index dd1a81ae..1f43f313 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -41,6 +41,8 @@ rate=0.45 # 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 diff --git a/config/settings/settings.conf.orig b/config/settings/settings.conf.orig index 13711a11..a9e8acdb 100644 --- a/config/settings/settings.conf.orig +++ b/config/settings/settings.conf.orig @@ -39,6 +39,8 @@ rate=0.45 # 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 diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index d7ac3576..ce9c571f 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -12,6 +12,8 @@ enabled=True driver=speechd rate=0.85 pitch=0.5 +# Pitch for capital letters +capitalPitch=0.9 module=espeak voice= language=english-us diff --git a/config/sound/default/caps.opus b/config/sound/default/caps.opus deleted file mode 100644 index 2e5d92e6..00000000 Binary files a/config/sound/default/caps.opus and /dev/null differ diff --git a/config/sound/default/caps.wav b/config/sound/default/caps.wav deleted file mode 100644 index f9120bca..00000000 Binary files a/config/sound/default/caps.wav and /dev/null differ diff --git a/config/sound/default/soundicons.conf b/config/sound/default/soundicons.conf index f2ccf032..02782f10 100644 --- a/config/sound/default/soundicons.conf +++ b/config/sound/default/soundicons.conf @@ -46,3 +46,5 @@ HasAttributes='HasAttributes.opus' PromotedText='PromotedText.opus' # missspelled indicator mispell='mispell.opus' +# the for capital letter: +capital='Caps.opus' diff --git a/config/sound/template/soundicons.conf b/config/sound/template/soundicons.conf index f8ff12f9..fadbbb0b 100644 --- a/config/sound/template/soundicons.conf +++ b/config/sound/template/soundicons.conf @@ -46,3 +46,5 @@ HasAttributes='' PromotedText='' # misspelled indicator mispell='' +# the for capital letter: +capital='' diff --git a/src/fenrir-package/commands/commands/review_curr_char.py b/src/fenrir-package/commands/commands/review_curr_char.py index 9b9a1122..d57b792f 100644 --- a/src/fenrir-package/commands/commands/review_curr_char.py +++ b/src/fenrir-package/commands/commands/review_curr_char.py @@ -26,7 +26,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_next_char.py b/src/fenrir-package/commands/commands/review_next_char.py index 66a1aebb..a35c4008 100644 --- a/src/fenrir-package/commands/commands/review_next_char.py +++ b/src/fenrir-package/commands/commands/review_next_char.py @@ -28,7 +28,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_prev_char.py b/src/fenrir-package/commands/commands/review_prev_char.py index 61ea11dc..4f5c704b 100644 --- a/src/fenrir-package/commands/commands/review_prev_char.py +++ b/src/fenrir-package/commands/commands/review_prev_char.py @@ -28,7 +28,7 @@ class command(): if currChar.strip(" \t\n") == '': self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py index 9c387055..a1920e8c 100644 --- a/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py +++ b/src/fenrir-package/commands/onInput/45000-present_char_if_cursor_change_horizontal.py @@ -32,7 +32,7 @@ class command(): return currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']] if not currChar.strip(" \t\n") == '': - self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/50000-char_echo.py b/src/fenrir-package/commands/onInput/50000-char_echo.py index 82816112..528b6530 100644 --- a/src/fenrir-package/commands/onInput/50000-char_echo.py +++ b/src/fenrir-package/commands/onInput/50000-char_echo.py @@ -30,7 +30,7 @@ class command(): # big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now) if len(self.env['screenData']['newDelta']) > 3: return - self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True) + self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py index bd7705a1..4b20a094 100644 --- a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py +++ b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py @@ -36,7 +36,8 @@ class command(): # too much for a single backspace... if len(self.env['screenData']['newNegativeDelta']) >= 5: return - self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True) + + self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True) def setCallback(self, callback): pass diff --git a/src/fenrir-package/core/outputManager.py b/src/fenrir-package/core/outputManager.py index 64ff9b6b..1a817acd 100644 --- a/src/fenrir-package/core/outputManager.py +++ b/src/fenrir-package/core/outputManager.py @@ -5,6 +5,7 @@ # By Chrys, Storm Dragon, and contributers. from core import debug +import string class outputManager(): def __init__(self): @@ -20,15 +21,20 @@ class outputManager(): self.env['runtime']['settingsManager'].shutdownDriver('soundDriver') self.env['runtime']['settingsManager'].shutdownDriver('speechDriver') - def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False): + def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False): self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO) if self.playSoundIcon(soundIcon, interrupt): self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) return - self.speakText(text, interrupt, ignorePunctuation) + toAnnounceCapital = announceCapital and len(text.strip(' \n\t')) == 1 and text.strip(' \n\t').isupper() + if toAnnounceCapital: + if self.playSoundIcon('capital', False): + toAnnounceCapital = False + + self.speakText(text, interrupt, ignorePunctuation,toAnnounceCapital) self.brailleText(text, interrupt) - def speakText(self, text, interrupt=True, ignorePunctuation=False): + def speakText(self, text, interrupt=True, ignorePunctuation=False, announceCapital=False): if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'): self.env['runtime']['debug'].writeDebugOut("Speech disabled in outputManager.speakText",debug.debugLevel.INFO) return @@ -50,7 +56,10 @@ class outputManager(): self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) try: - self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')) + if announceCapital: + self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'capitalPitch')) + else: + self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')) except Exception as e: self.env['runtime']['debug'].writeDebugOut("setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index 2940918c..7e97843f 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -20,6 +20,7 @@ settings = { 'driver': 'speechd', 'rate': 0.75, 'pitch': 0.5, + 'capitalPitch':0.8, 'volume': 1.0, 'module': '', 'voice': 'de',