[orca/gnome-3-38] Check for pauses-only results when generating speech
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-38] Check for pauses-only results when generating speech
- Date: Wed, 6 Jan 2021 14:58:59 +0000 (UTC)
commit f959099c411eedb63370c69fde6ff68e250e1da9
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Jan 6 12:35:45 2021 +0100
Check for pauses-only results when generating speech
For most accessible objects, we attempt to generate lots of things
(e.g. role, relevant states, displayed text, selection, etc.) and
by default we separate these pieces of information by pauses. In
some cases (e.g. an empty paragraph) it is possible to generate
results consisting solely of pauses. We don't want to treat that as
actual results because it can cause other logic (e.g. saying "blank")
to not kick in and lead to our speaking nothing.
src/orca/speech_generator.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index cdba115b2..5dc2b71a7 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -114,7 +114,13 @@ class SpeechGenerator(generator.Generator):
globalsDict['voice'] = self.voice
def generateSpeech(self, obj, **args):
- return self.generate(obj, **args)
+ rv = self.generate(obj, **args)
+ if rv and not list(filter(lambda x: not isinstance(x, Pause), rv)):
+ msg = 'SPEECH GENERATOR: Results for %s are pauses only' % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+ rv = []
+
+ return rv
def _resultElementToString(self, element, includeAll=True):
if debug.LEVEL_ALL < debug.debugLevel:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]