Skip to content

Preserve "established" voice attribute from voice settings

Colomban Wendling requested to merge cwendling/orca:voice-prop into master

Having no attributes has problematic side effects, including sayAll not working in web script.


Today I debugged with the help of Alex a situation where our Orca was properly gathering the information for SayAll on a web page in Firefox (c.g. debug log, I could see the info gathered), but failed to emit any sound (it never reached the speech dispatcher module according to the debug log).

After much fiddling around, I finally realized that the root cause was that on our profile the "default" voice did not have any property set (not even "established:false"), and I believe what happens is that for a chain of reasons it prevents web script's sayAll from emitting anything:

  1. it creates a empty ACSS dict (which I believe is a bug, which this PR tries to fix)
  2. an empty ACSS is filtered out in web/speech_generator.py:generateSpeech() (list(filter(lambda x: x, …)))
  3. web/script.py:textLines() enforces a 1:1 mapping of voices and data, with no fallback if the voice is missing (if len(elements) != len(voices): continue).

Anyhow, it bugged me that our profile settings were broken, given that they were generated by Orca itself. I thus tried master (3.33.4pre) after removing all configuration, and unfortunately I could reproduce the problem straight off the bat. To do so:

  1. remove Orca's configuration (rm -rf ~/.local/share/orca)
  2. start Orca
  3. got to e.g. http://hypra.fr/-Qu-est-ce-qu-Hypra-7-.html
    1. reach the "Notre vision" title ("h" twice should do)
    2. trigger "say all" (KP+)

If it worked, it'd start reading on starting at "notre vision" and carrying on to the quote and subsequent paragraphs. What I get is no speech at all.

To "fix" this, all you have to do is open Orca's preferences and save (yes, no modifications needed). Then, try it again and you'll get proper sound.

The difference in the config file is that now there's a "voices" entry properly populated in the "default" profile section.

Now, brace for the best: open the preferences again, and save them again: Say All fails again.

The patch here is simply preserving the "established" property when loading an ACSS, which seems the expected thing given it's added if there are no property at all.

Edited by Colomban Wendling

Merge request reports