Added setting readNumbersAsDigits.

This commit is contained in:
Storm Dragon 2024-03-13 00:56:53 -04:00
parent a7b28af947
commit c3d1ccd10b
11 changed files with 30 additions and 1 deletions

View File

@ -64,6 +64,9 @@ language=en_US
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -72,7 +72,9 @@ language=en
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# genericSpeechCommand is the command that is executed for talking # Speak individual numbers instead of whole string.
readNumbersAsDigits': False# genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values
# fenrirText = is the text that should be spoken # fenrirText = is the text that should be spoken
# fenrirModule = may be the speech module like used in speech-dispatcher, not every TTY need this # fenrirModule = may be the speech module like used in speech-dispatcher, not every TTY need this

View File

@ -66,6 +66,9 @@ voice=en-us
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -66,6 +66,9 @@ voice=en-us
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -68,6 +68,9 @@ volume=1.0
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values
# fenrirText = is the text that should be spoken # fenrirText = is the text that should be spoken

View File

@ -68,6 +68,9 @@ voice=0
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values
# fenrirText = is the text that should be spoken # fenrirText = is the text that should be spoken

View File

@ -67,6 +67,9 @@ voice=en-us
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -21,6 +21,9 @@ voice=en-us
language=en-us language=en-us
volume=0.6 volume=0.6
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -66,6 +66,9 @@ language=english-us
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True autoReadIncoming=True
# Speak individual numbers instead of whole string.
readNumbersAsDigits': False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values

View File

@ -27,6 +27,8 @@ class outputManager():
def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False, flush=True, brailleAlternative = ''): def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False, flush=True, brailleAlternative = ''):
if text == '': if text == '':
return return
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'readNumbersAsDigits'):
text = re.sub(r"(\d)", r"\1 ", text).rstrip()
self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO)
if self.playSoundIcon(soundIcon, interrupt): if self.playSoundIcon(soundIcon, interrupt):
self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO)

View File

@ -27,6 +27,7 @@ settingsData = {
'voice': 'en-us', 'voice': 'en-us',
'language': '', 'language': '',
'autoReadIncoming': True, 'autoReadIncoming': True,
'readNumbersAsDigits': False,
'genericSpeechCommand':'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"', 'genericSpeechCommand':'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"',
'fenrirMinVolume':0, 'fenrirMinVolume':0,
'fenrirMaxVolume':200, 'fenrirMaxVolume':200,