[orca] Improve reliability of profile-based synthesis switching
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Improve reliability of profile-based synthesis switching
- Date: Mon, 18 Jul 2016 22:18:51 +0000 (UTC)
commit 86e2193e31e7933ee2216fc3dc6d2606047f32a7
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Jul 18 18:16:19 2016 -0400
Improve reliability of profile-based synthesis switching
* Get voices from the speechgenerator; not the script
* Set voices that were not being set
* Always reset the voice when the name has changed
* Reset any property when it has not been explicitly set to a new value
src/orca/chat.py | 14 ++--
src/orca/script.py | 1 -
src/orca/scripts/apps/notify-osd/script.py | 10 ++-
src/orca/scripts/apps/soffice/spellcheck.py | 6 +-
src/orca/scripts/default.py | 110 ++++++------------------
src/orca/scripts/toolkits/WebKitGtk/script.py | 6 +-
src/orca/speech.py | 5 +-
src/orca/speech_generator.py | 2 +
src/orca/speechdispatcherfactory.py | 56 +++++++++----
src/orca/spellcheck.py | 27 ++++---
10 files changed, 106 insertions(+), 131 deletions(-)
---
diff --git a/src/orca/chat.py b/src/orca/chat.py
index 95922be..f8a8ba0 100644
--- a/src/orca/chat.py
+++ b/src/orca/chat.py
@@ -35,7 +35,6 @@ from . import messages
from . import orca_state
from . import settings
from . import settings_manager
-from . import speech
_settingsManager = settings_manager.getManager()
@@ -596,7 +595,8 @@ class Chat:
text = self._script.utilities.appendString(text, message)
if len(text.strip()):
- speech.speak(text)
+ voice = self._script.speechGenerator.voice(string=text)
+ self._script.speakMessage(text, voice=voice)
self._script.displayBrailleMessage(text)
def getMessageFromEvent(self, event):
@@ -677,11 +677,8 @@ class Chat:
elif self.isAutoCompletedTextEvent(event):
text = event.any_data
- if text.isupper():
- speech.speak(text,
- self._script.voices[settings.UPPERCASE_VOICE])
- else:
- speech.speak(text)
+ voice = self._script.speechGenerator.voice(string=text)
+ self._script.speakMessage(text, voice=voice)
return True
return False
@@ -700,7 +697,8 @@ class Chat:
if _settingsManager.getSetting('chatAnnounceBuddyTyping'):
conversation = self.getConversation(event.source)
if conversation and (status != conversation.getTypingStatus()):
- speech.speak(status)
+ voice = self._script.speechGenerator.voice(string=status)
+ self._script.speakMessage(status, voice=voice)
conversation.setTypingStatus(status)
return True
diff --git a/src/orca/script.py b/src/orca/script.py
index d213697..7eff80b 100644
--- a/src/orca/script.py
+++ b/src/orca/script.py
@@ -118,7 +118,6 @@ class Script:
self.eventCache = {}
self.whereAmI = self.getWhereAmI()
self.spellcheck = self.getSpellCheck()
- self.voices = settings.voices
self.tutorialGenerator = self.getTutorialGenerator()
self.flatReviewContextClass = flat_review.Context
diff --git a/src/orca/scripts/apps/notify-osd/script.py b/src/orca/scripts/apps/notify-osd/script.py
index f719dce..8137813 100644
--- a/src/orca/scripts/apps/notify-osd/script.py
+++ b/src/orca/scripts/apps/notify-osd/script.py
@@ -28,9 +28,12 @@ __license__ = "LGPL"
import orca.messages as messages
import orca.scripts.default as default
import orca.settings as settings
+import orca.settings_manager as settings_manager
import orca.speech as speech
import orca.notification_messages as notification_messages
+_settingsManager = settings_manager.getManager()
+
########################################################################
# #
# The notify-osd script class. #
@@ -61,19 +64,20 @@ class Script(default.Script):
utterances = []
message = ""
+ voices = _settingsManager.getSetting('voices')
if value < 0:
utterances.append(messages.NOTIFICATION)
- utterances.append(self.voices.get(settings.SYSTEM_VOICE))
+ utterances.append(voices.get(settings.SYSTEM_VOICE))
message = '%s %s' % (event.source.name, event.source.description)
utterances.append(message)
- utterances.append(self.voices.get(settings.DEFAULT_VOICE))
+ utterances.append(voices.get(settings.DEFAULT_VOICE))
else:
# A gauge notification, e.g. the Ubuntu volume notification that
# appears when you press the multimedia keys.
#
message = '%s %d' % (event.source.name, value)
utterances.append(message)
- utterances.append(self.voices.get(settings.SYSTEM_VOICE))
+ utterances.append(voices.get(settings.SYSTEM_VOICE))
speech.speak(utterances, None, True)
self.displayBrailleMessage(message, flashTime=settings.brailleFlashTime)
diff --git a/src/orca/scripts/apps/soffice/spellcheck.py b/src/orca/scripts/apps/soffice/spellcheck.py
index 307ce41..c67a34c 100644
--- a/src/orca/scripts/apps/soffice/spellcheck.py
+++ b/src/orca/scripts/apps/soffice/spellcheck.py
@@ -31,7 +31,6 @@ import pyatspi
from orca import debug
from orca import messages
-from orca import settings
from orca import spellcheck
@@ -100,6 +99,7 @@ class SpellCheck(spellcheck.SpellCheck):
if not string:
return False
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.speakMessage(messages.MISSPELLED_WORD_CONTEXT % string, voice=voice)
+ msg = messages.MISSPELLED_WORD_CONTEXT % string
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.speakMessage(msg, voice=voice)
return True
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index ac19dc4..803c4ab 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -828,15 +828,11 @@ class Script(script.Script):
shouldNotInterrupt = \
self.windowActivateTime and time.time() - self.windowActivateTime < 1
- # [[[TODO: WDW - this should move to the generator.]]]
- if newLocusOfFocus.getRole() == pyatspi.ROLE_LINK:
- voice = self.voices[settings.HYPERLINK_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
utterances = self.speechGenerator.generateSpeech(
newLocusOfFocus,
priorObj=oldLocusOfFocus)
- speech.speak(utterances, voice, not shouldNotInterrupt)
+
+ speech.speak(utterances, interrupt=not shouldNotInterrupt)
self._saveFocusedObjectInfo(newLocusOfFocus)
def activate(self):
@@ -1247,25 +1243,14 @@ class Script(script.Script):
obj = orca_state.locusOfFocus
self.updateBraille(obj)
- voice = self.voices[settings.DEFAULT_VOICE]
frame, dialog = self.utilities.frameAndDialog(obj)
if frame:
- # In windows with lots of objects (Thunderbird, Firefox, etc.)
- # If we wait until we've checked for both the status bar and
- # a default button, there may be a noticable delay. Therefore,
- # speak the status bar info immediately and then go looking
- # for a default button.
- #
- msg = self.speechGenerator.generateStatusBar(frame)
- if msg:
- self.presentMessage(msg, voice=voice)
+ speech.speak(self.speechGenerator.generateStatusBar(frame))
window = dialog or frame
if window:
- msg = self.speechGenerator.generateDefaultButton(window)
- if msg:
- self.presentMessage(msg, voice=voice)
+ speech.speak(self.speechGenerator.generateDefaultButton(window))
def presentTitle(self, inputEvent):
"""Speaks and brailles the title of the window with focus."""
@@ -1362,6 +1347,8 @@ class Script(script.Script):
[wordString, x, y, width, height] = \
context.getCurrent(flat_review.Context.WORD)
+ voice = self.speechGenerator.voice(string=wordString)
+
# Don't announce anything from speech if the user used
# the Braille display as an input device.
#
@@ -1378,15 +1365,14 @@ class Script(script.Script):
elif wordString.isspace():
speech.speak(messages.WHITE_SPACE)
elif wordString.isupper() and speechType == 1:
- speech.speak(wordString,
- self.voices[settings.UPPERCASE_VOICE])
+ speech.speak(wordString, voice)
elif speechType == 2:
self.spellCurrentItem(wordString)
elif speechType == 3:
self.phoneticSpellCurrentItem(wordString)
elif speechType == 1:
wordString = self.utilities.adjustForRepeats(wordString)
- speech.speak(wordString)
+ speech.speak(wordString, voice)
self.updateBrailleReview(targetCursorCell)
self.currentReviewContents = wordString
@@ -1610,6 +1596,8 @@ class Script(script.Script):
[lineString, x, y, width, height] = \
context.getCurrent(flat_review.Context.LINE)
+ voice = self.speechGenerator.voice(string=lineString)
+
# Don't announce anything from speech if the user used
# the Braille display as an input device.
#
@@ -1620,16 +1608,15 @@ class Script(script.Script):
speech.speak(messages.BLANK)
elif lineString.isspace():
speech.speak(messages.WHITE_SPACE)
- elif lineString.isupper() \
- and (speechType < 2 or speechType > 3):
- speech.speak(lineString, self.voices[settings.UPPERCASE_VOICE])
+ elif lineString.isupper() and (speechType < 2 or speechType > 3):
+ speech.speak(lineString, voice)
elif speechType == 2:
self.spellCurrentItem(lineString)
elif speechType == 3:
self.phoneticSpellCurrentItem(lineString)
else:
lineString = self.utilities.adjustForRepeats(lineString)
- speech.speak(lineString)
+ speech.speak(lineString, voice)
self.updateBrailleReview()
self.currentReviewContents = lineString
@@ -1893,12 +1880,7 @@ class Script(script.Script):
_settingsManager.setProfile(profileID, updateLocale=True)
- # TODO: The right fix is to go find each and every case where we use
- # self.voices directly and instead get the voices from the Settings
- # Manager. But that's too big a change too close to code freeze. So
- # for now we'll hack.
speech.shutdown()
- self.voices = _settingsManager.getSetting('voices')
speech.init()
# TODO: This is another "too close to code freeze" hack to cause the
@@ -2379,11 +2361,10 @@ class Script(script.Script):
# expandable state if appropriate for the object type. The generators
# need to gain some smarts w.r.t. state changes.
- voice = self.voices.get(settings.SYSTEM_VOICE)
if event.detail1:
- speech.speak(messages.TEXT_SELECTED, voice, False)
+ self.speakMessage(messages.TEXT_SELECTED, interrupt=False)
else:
- speech.speak(messages.TEXT_UNSELECTED, voice, False)
+ self.speakMessage(messages.TEXT_UNSELECTED, interrupt=False)
self.pointOfReference['selectedChange'] = hash(obj), event.detail1
@@ -2561,10 +2542,9 @@ class Script(script.Script):
if len(string) == 1:
self.speakCharacter(string)
- elif string.isupper():
- speech.speak(string, self.voices[settings.UPPERCASE_VOICE])
else:
- speech.speak(string, self.voices[settings.DEFAULT_VOICE])
+ voice = self.speechGenerator.voice(string=string)
+ speech.speak(string, voice)
def onTextInserted(self, event):
"""Callback for object:text-changed:insert accessibility events."""
@@ -2625,10 +2605,9 @@ class Script(script.Script):
if speakString:
if len(string) == 1:
self.speakCharacter(string)
- elif string.isupper():
- speech.speak(string, self.voices[settings.UPPERCASE_VOICE])
else:
- speech.speak(string, self.voices[settings.DEFAULT_VOICE])
+ voice = self.speechGenerator.voice(string=string)
+ speech.speak(string, voice)
if len(string) != 1:
return
@@ -3049,13 +3028,7 @@ class Script(script.Script):
sentence = self.utilities.substring(obj, sentenceStartOffset + 1,
sentenceEndOffset + 1)
- if self.utilities.linkIndex(obj, sentenceStartOffset + 1) >= 0:
- voice = self.voices[settings.HYPERLINK_VOICE]
- elif sentence.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
-
+ voice = self.speechGenerator.voice(string=voice)
sentence = self.utilities.adjustForRepeats(sentence)
speech.speak(sentence, voice)
return True
@@ -3131,13 +3104,7 @@ class Script(script.Script):
word = self.utilities.\
substring(obj, wordStartOffset + 1, wordEndOffset + 1)
- if self.utilities.linkIndex(obj, wordStartOffset + 1) >= 0:
- voice = self.voices[settings.HYPERLINK_VOICE]
- elif word.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
-
+ voice = self.speechGenerator.voice(string=word)
word = self.utilities.adjustForRepeats(word)
speech.speak(word, voice)
return True
@@ -3190,13 +3157,6 @@ class Script(script.Script):
if not character or character == '\r':
character = "\n"
- if self.utilities.linkIndex(obj, offset) >= 0:
- voice = self.voices[settings.HYPERLINK_VOICE]
- elif character.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
-
speakBlankLines = _settingsManager.getSetting('speakBlankLines')
if character == "\n":
line = text.getTextAtOffset(max(0, offset),
@@ -3309,15 +3269,10 @@ class Script(script.Script):
if lastChar == "\n" and lastWord != word:
self.speakCharacter("\n")
- if self.utilities.linkIndex(obj, offset) >= 0:
- voice = self.voices[settings.HYPERLINK_VOICE]
- elif word.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
self.speakMisspelledIndicator(obj, startOffset)
+ voice = self.speechGenerator.voice(string=word)
word = self.utilities.adjustForRepeats(word)
self._lastWord = word
speech.speak(word, voice)
@@ -3537,13 +3492,10 @@ class Script(script.Script):
lastEndOffset = endOffset
offset = endOffset
+ voice = self.speechGenerator.voice(string=lineString)
lineString = \
self.utilities.adjustForLinks(obj, lineString, startOffset)
lineString = self.utilities.adjustForRepeats(lineString)
- if lineString.isupper():
- voice = settings.voices[settings.UPPERCASE_VOICE]
- else:
- voice = settings.voices[settings.DEFAULT_VOICE]
context = speechserver.SayAllContext(
obj, lineString, startOffset, endOffset)
@@ -3647,11 +3599,7 @@ class Script(script.Script):
"""
for (charIndex, character) in enumerate(itemString):
- if character.isupper():
- voice = settings.voices[settings.UPPERCASE_VOICE]
- character = character.lower()
- else:
- voice = settings.voices[settings.DEFAULT_VOICE]
+ voice = self.speechGenerator.voice(string=character)
phoneticString = phonnames.getPhoneticName(character)
speech.speak(phoneticString, voice)
@@ -4205,11 +4153,7 @@ class Script(script.Script):
"""Method to speak a single character. Scripts should use this
method rather than calling speech.speakCharacter directly."""
- if character.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
-
+ voice = self.speechGenerator.voice(string=character)
spokenCharacter = chnames.getCharacterName(character)
speech.speakCharacter(spokenCharacter, voice)
@@ -4228,7 +4172,9 @@ class Script(script.Script):
or _settingsManager.getSetting('onlySpeakDisplayedText'):
return
- systemVoice = self.voices.get(settings.SYSTEM_VOICE)
+ voices = _settingsManager.getSetting('voices')
+ systemVoice = voices.get(settings.SYSTEM_VOICE)
+
voice = voice or systemVoice
if voice == systemVoice and resetStyles:
capStyle = _settingsManager.getSetting('capitalizationStyle')
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index 67bea33..fd5ff30 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -347,11 +347,7 @@ class Script(default.Script):
phrase = self.utilities.substring(obj, startOffset, endOffset)
if len(phrase) and phrase != "\n":
- if phrase.isupper():
- voice = self.voices[settings.UPPERCASE_VOICE]
- else:
- voice = self.voices[settings.DEFAULT_VOICE]
-
+ voice = self.speechGenerator.voice(string=phrase)
phrase = self.utilities.adjustForRepeats(phrase)
links = [x for x in obj if x.getRole() == pyatspi.ROLE_LINK]
if links:
diff --git a/src/orca/speech.py b/src/orca/speech.py
index e5295fa..8cd0506 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -124,8 +124,10 @@ def init():
debug.println(debug.LEVEL_INFO, 'SPEECH: Initialized', True)
def __resolveACSS(acss=None):
- if acss:
+ if isinstance(acss, ACSS):
return acss
+ elif isinstance(acss, list) and len(acss) == 1:
+ return ACSS(acss[0])
else:
voices = settings.voices
return ACSS(voices[settings.DEFAULT_VOICE])
@@ -251,6 +253,7 @@ def speakCharacter(character, acss=None):
if settings.silenceSpeech:
return
+ acss = __resolveACSS(acss)
msg = "SPEECH OUTPUT: '" + character + "' " + str(acss)
debug.println(debug.LEVEL_INFO, msg, True)
log.info("SPEECH OUTPUT: '%s'" % character)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index d9f12f5..8c250f0 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1721,6 +1721,8 @@ class SpeechGenerator(generator.Generator):
name = self._generateName(button)
if name:
result.append(messages.DEFAULT_BUTTON_IS % name[0])
+ result.extend(self.voice(SYSTEM))
+
return result
def generateDefaultButton(self, obj, **args):
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index ba7b617..151cc53 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -213,15 +213,29 @@ class SpeechServer(speechserver.SpeechServer):
volume = int(15 * max(0, min(9, acss_volume)) - 35)
self._send_command(self._client.set_volume, volume)
- def _set_family(self, acss_family):
+ def _get_language_and_dialect(self, acss_family):
+ if acss_family is None:
+ acss_family = {}
+
familyLocale = acss_family.get(speechserver.VoiceFamily.LOCALE)
if not familyLocale:
import locale
familyLocale, encoding = locale.getdefaultlocale()
+
+ language, dialect = '', ''
if familyLocale:
- lang = familyLocale.split('_')[0]
- if lang and len(lang) == 2:
- self._send_command(self._client.set_language, str(lang))
+ localeValues = familyLocale.split('_')
+ language = localeValues[0]
+ if len(localeValues) == 2:
+ dialect = localeValues[1]
+
+ return language, dialect
+
+ def _set_family(self, acss_family):
+ lang, dialect = self._get_language_and_dialect(acss_family)
+ if len(lang) == 2:
+ self._send_command(self._client.set_language, lang)
+
try:
# This command is not available with older SD versions.
set_synthesis_voice = self._client.set_synthesis_voice
@@ -229,8 +243,7 @@ class SpeechServer(speechserver.SpeechServer):
pass
else:
name = acss_family.get(speechserver.VoiceFamily.NAME)
- if name != self._default_voice_name:
- self._send_command(set_synthesis_voice, name)
+ self._send_command(set_synthesis_voice, name)
def _debug_sd_values(self, prefix=""):
if debug.debugLevel > debug.LEVEL_INFO:
@@ -239,18 +252,25 @@ class SpeechServer(speechserver.SpeechServer):
try:
sd_rate = self._send_command(self._client.get_rate)
sd_pitch = self._send_command(self._client.get_pitch)
+ sd_volume = self._send_command(self._client.get_volume)
+ sd_language = self._send_command(self._client.get_language)
except:
- sd_rate = "(exception occurred)"
- sd_pitch = "(exception occurred)"
+ sd_rate = sd_pitch = sd_volume = sd_language = "(exception occurred)"
+
+ family = self._current_voice_properties.get(ACSS.FAMILY)
current = self._current_voice_properties
- msg = "SPEECH DISPATCHER: %sOrca rate %s, pitch %s; " \
- "SD rate %s, pitch %s" % \
+ msg = "SPEECH DISPATCHER: %sOrca rate %s, pitch %s, volume %s, language %s; " \
+ "SD rate %s, pitch %s, volume %s, language %s" % \
(prefix,
self._current_voice_properties.get(ACSS.RATE),
self._current_voice_properties.get(ACSS.AVERAGE_PITCH),
+ self._current_voice_properties.get(ACSS.GAIN),
+ self._get_language_and_dialect(family)[0],
sd_rate,
- sd_pitch)
+ sd_pitch,
+ sd_volume,
+ sd_language)
debug.println(debug.LEVEL_INFO, msg, True)
def _apply_acss(self, acss):
@@ -266,11 +286,13 @@ class SpeechServer(speechserver.SpeechServer):
elif acss_property == ACSS.AVERAGE_PITCH:
method(5.0)
current[acss_property] = 5.0
- elif acss_property == ACSS.FAMILY \
- and acss == settings.voices[settings.DEFAULT_VOICE]:
- # We need to explicitly reset (at least) the family.
- # See bgo#626072.
- #
+ elif acss_property == ACSS.GAIN:
+ method(10)
+ current[acss_property] = 5.0
+ elif acss_property == ACSS.RATE:
+ method(50)
+ current[acss_property] = 5.0
+ elif acss_property == ACSS.FAMILY:
method({})
current[acss_property] = {}
@@ -398,7 +420,7 @@ class SpeechServer(speechserver.SpeechServer):
try:
volume = acss[ACSS.GAIN]
except KeyError:
- volume = 5
+ volume = 10
acss[ACSS.GAIN] = max(0, min(9, volume + delta))
msg = 'SPEECH DISPATCHER: Volume set to %d' % volume
debug.println(debug.LEVEL_INFO, msg, True)
diff --git a/src/orca/spellcheck.py b/src/orca/spellcheck.py
index ac2e125..ad3b6e6 100644
--- a/src/orca/spellcheck.py
+++ b/src/orca/spellcheck.py
@@ -34,7 +34,6 @@ from orca import guilabels
from orca import messages
from orca import object_properties
from orca import orca_state
-from orca import settings
from orca import settings_manager
_settingsManager = settings_manager.getManager()
@@ -160,8 +159,9 @@ class SpellCheck:
if not string:
return False
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.speakMessage(messages.MISSPELLED_WORD_CONTEXT % string, voice=voice)
+ msg = messages.MISSPELLED_WORD_CONTEXT % string
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.speakMessage(msg, voice=voice)
return True
def presentCompletionMessage(self):
@@ -169,8 +169,9 @@ class SpellCheck:
return False
self._script.clearBraille()
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.presentMessage(self.getCompletionMessage(), voice=voice)
+ msg = self.getCompletionMessage()
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.presentMessage(msg, voice=voice)
return True
def presentErrorDetails(self, detailed=False):
@@ -193,8 +194,9 @@ class SpellCheck:
if not word:
return False
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.speakMessage(messages.MISSPELLED_WORD % word, voice=voice)
+ msg = messages.MISSPELLED_WORD % word
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.speakMessage(msg, voice=voice)
if detailed or _settingsManager.getSetting('spellcheckSpellError'):
self._script.spellCurrentItem(word)
@@ -213,8 +215,9 @@ class SpellCheck:
label = self._script.utilities.displayedLabel(entry) or entry.name
string = self._script.utilities.substring(entry, 0, -1)
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.speakMessage("%s %s" % (label, string), voice=voice)
+ msg = "%s %s" % (label, string)
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.speakMessage(msg, voice=voice)
if detailed or _settingsManager.getSetting('spellcheckSpellSuggestion'):
self._script.spellCurrentItem(string)
@@ -237,8 +240,10 @@ class SpellCheck:
else:
label = ""
string = items[0].name
- voice = self._script.voices.get(settings.DEFAULT_VOICE)
- self._script.speakMessage(("%s %s" % (label, string)).strip(), voice=voice)
+
+ msg = "%s %s" % (label, string)
+ voice = self._script.speechGenerator.voice(string=msg)
+ self._script.speakMessage(msg.strip(), voice=voice)
if detailed or _settingsManager.getSetting('spellcheckSpellSuggestion'):
self._script.spellCurrentItem(string)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]