announce capital letters in keyecho, deleteecho, char review next,prev/current and arrow left right
This commit is contained in:
parent
7bfe243f56
commit
2c539ba0f8
3
TODO
3
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Binary file not shown.
Binary file not shown.
@ -46,3 +46,5 @@ HasAttributes='HasAttributes.opus'
|
||||
PromotedText='PromotedText.opus'
|
||||
# missspelled indicator
|
||||
mispell='mispell.opus'
|
||||
# the for capital letter:
|
||||
capital='Caps.opus'
|
||||
|
@ -46,3 +46,5 @@ HasAttributes=''
|
||||
PromotedText=''
|
||||
# misspelled indicator
|
||||
mispell=''
|
||||
# the for capital letter:
|
||||
capital=''
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -20,6 +20,7 @@ settings = {
|
||||
'driver': 'speechd',
|
||||
'rate': 0.75,
|
||||
'pitch': 0.5,
|
||||
'capitalPitch':0.8,
|
||||
'volume': 1.0,
|
||||
'module': '',
|
||||
'voice': 'de',
|
||||
|
Loading…
Reference in New Issue
Block a user