Don't fail to speak single letters if speechViewer or speech logging is enabled#10879
Conversation
… into a list first, as we may be iterating over it multiple times (E.g. logging bad sequence types, appending to speech viewer, sending to the synth).
|
Could you elaborate on when a speech sequence is a generator? Note that |
|
@LeonarddeR it seems that getSpellingSpeech is returning a generator and this is what is supplied to speech.speak. I'll let @feerrenrut provide more info on why he had chosen to return generators rather than lists. |
|
@michaelDCurran @LeonarddeR Actually |
|
One problem with this is that any addon which patches speech.speak (for example Speech History) now has to know about flattening these lists. If they don't, then characters don't read because of the generators. |
|
Hello!
I have forked the speechHistory from James Scholes, created the add-on
package and it is working alright in 2020.1 Beta1...
It is available at:
https://www.dropbox.com/s/q909ujrdiz0wjg8/speechHistory.nvda-addon?dl=1
Rui Fontes
Às 19:50 de 27/03/2020, Tyler Spivey escreveu:
…
One problem with this is that any addon which patches speech.speak
(for example Speech History) now has to know about flattening these
lists. If they don't, then characters don't read because of the
generators.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10879 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZAPRTLZTCTNZ23IQW7QKTRJT7O7ANCNFSM4LL2CWKA>.
|
|
@michaelDCurran @feerrenrut Are you planning to do anything with this commend by @tspivey ? This is quite problematic because in the current state breaking changes should not be made as there was no update to the addonAPI |
PRs #10878 and #10879 addressed some issues with Speech.speak being passed a Generator. Rather than create a list from it, ensure that the generator is not passed in the first place. The typing of several functions is no much more clear, in particular _flattenNestedSequences now no longer implicitly converts generators to lists. However, in all places it is used, generators are explicitly converted to lists. Logging of generator types has been added in several places, enabled via the advanced settings panel 'speech' debug logging category.
PRs #10878 and #10879 addressed some issues with Speech.speak being passed a Generator. Rather than create a list from it, ensure that the generator is not passed in the first place. The typing of several functions is no much more clear, in particular _flattenNestedSequences now no longer implicitly converts generators to lists. However, in all places it is used, generators are explicitly converted to lists. Logging of generator types has been added in several places, enabled via the advanced settings panel 'speech' debug logging category.
PRs #10878 and #10879 addressed some issues with Speech.speak being passed a Generator. Fixed a bug in speakTextInfo. speakWithoutPauses does not accept a generator as it needs to be able to get the number of items in the sequence and slice it. Rather than create a list from the generator inside Speech.speak, ensure that the generator is not used as an argument in the first place. The typing of several functions has now been clarified, in particular _flattenNestedSequences now no longer implicitly converts generators to lists. However, now all usages of _flattenNestedSequences explicitly convert to lists. Logging of generator types has been added in several places including speakWithoutPauses which needs to be able to get the length of a sequence and slice it. The logging can be enabled via the advanced settings panel 'speech' debug logging category.
Link to issue number:
Fixes #10741
Summary of the issue:
NVDa fails to announce single letters when moving with the arrow keys and or reviewing by character, if either speechViewer is enabled, or the speech logging category is enabled in the Advanced settings panel.
The reason for this is that when speaking single letters, speech.speak is passed in a generator as the sequence, yet this generator tries to be iterated over up to 3 times (logging bad sequences, appending to speechViewer, and sending to the synth).
Description of how this pull request fixes the issue:
If the given sequence is a generator, flatten it into a list first.
Testing performed:
With neither speechViewer or speech logging enabled, speechViewer enabled but not speech logging, speech logging but not speechViewer, and both speechViewer and speech logging, move through text in notepad with the left and right arrows, ensuring that each character is read aloud.
Known issues with pull request:
None.
Change log entry:
None needed -- Regression introduced after 2019.3.