Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVDA add automatically speak character description function when cursor move #13509

Closed
LittleStar-VIP opened this issue Mar 20, 2022 · 32 comments · Fixed by #13550
Closed

NVDA add automatically speak character description function when cursor move #13509

LittleStar-VIP opened this issue Mar 20, 2022 · 32 comments · Fixed by #13550
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@LittleStar-VIP
Copy link

Is your feature request related to a problem? Please describe.

As I am a non-English user, I have to rely heavily on the character description function of NVDA, i.e. pressing numpad 2 twice to report the character description of character at current cursor focus.
Please imagine that, typing a piece of article and you have to press numpad 2 twice in almost every word is a nightmare.
In fact, I have been using the addon enhance Phonetic reading for years, but I have contacted the addon author several times, hope that the author can make the addon compatible with latest nvda version, but I have not received any feedback from the author.
As this function is really key to my daily usage, I hope nvda can one day add this function to the core application.

Describe the solution you'd like

  1. when user moves the cursor, both edit or review cursor, e.g. pressing right arrow
  2. after certain delay, e.g. after user defined number of seconds, nvda report character description of the character in focus automatically
    e.g. for English character, pressing arrow key may cause nvda to report a alpha automatically
    e.g. for non English character that has more than one character description, like Chinese, nvda can add a user defined variable to set the maximum number of character description to be automatically spoken

Describe alternatives you've considered

Additional context

@bdorer
Copy link

bdorer commented Mar 20, 2022 via email

@seanbudd seanbudd added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Mar 21, 2022
@XLTechie
Copy link
Collaborator

XLTechie commented Mar 21, 2022 via email

@Brian1Gaff
Copy link

Brian1Gaff commented Mar 21, 2022 via email

@cary-rowen
Copy link
Contributor

Yes, this feature is also useful in Chinese environment. Hope to see it in NVDA core.

@feerrenrut
Copy link
Contributor

Yes, we are happy for someone to start work on this.

@davidacm
Copy link
Contributor

Hi. I'm the developer of the add-on, I could implement it on the Core of NVDA. Although I have some doubts about the implementation. E.G. Python threads or wx.CallLater for the timers? Initially I used python threads, but that way had some incompatibilities with other add-ons. In the last beta version of this add-on, I've used wx.CallLater, and this workaround fixed those issues. But I don't know if this is correct, or can introduce another issues, although no one has reported issues so far.

@davidacm
Copy link
Contributor

Hi @LittleStar-VIP, sorry for my delaied response hehe. I usually receive a lot of e-mails and sometimes some messages go to the spam, etc.

The enhanced phonetic reading add-on, is compatible with the last stable version of NVDA. You can test the latest beta version from this link:
Enhanced phonetic reading

This version fix some issues, for example incompatibilities with bluetooth audio add-on. But could introduce new issues, because I used wx.CallLater and not python threads as in older versions.

I going to work in an implementation of this feature on the NVDA core, but in the meantime, you can use this version and you and others can send me feedback on the GitHub repo

@davidacm
Copy link
Contributor

Hi everybody. What do you think would be a good category to place the character descriptions settings?
is the way NVDA would handle character reading... But I can't figure out what would be a good category for this. For testing purposes maybe Advanced options initially I guess, although isn't a dangerous feature.

@cary-rowen
Copy link
Contributor

Hi @davidacm

Glad you'd like to implement this feature in NVDA core, I tend to place this option in NVDA's voice settings panel, This feature is somewhat similar to pitch change.

Thanks

@XLTechie
Copy link
Collaborator

XLTechie commented Mar 23, 2022 via email

@LittleStar-VIP
Copy link
Author

LittleStar-VIP commented Mar 23, 2022

@davidacm Thanks very much, this addon really help me a lot.

@LittleStar-VIP
Copy link
Author

LittleStar-VIP commented Mar 23, 2022

Yes, probably speech setting is the best location, unless new verbosity category is added.

@XLTechie
Copy link
Collaborator

XLTechie commented Mar 24, 2022 via email

@feerrenrut
Copy link
Contributor

Hard to give advice on whether core.callLater will fix the problems because I don't know what they were.

I'll try to give some background information instead.

wx.CallLater is typically used for GUI related behavior. Often code needs to respond to some event, but it wouldn't be correct to make a change while in the middle of processing that event. In these cases you defer the handling with wx.CallLater. It finishes processing the event and executes the call afterwards.

core.callLater is really just a wrapper around wx.CallLater, but it ensures that wx.CallLater is called from the main thread.

queueHandler.queueFunction(queueHandler.eventQueue, ... is a different but related approach. It does not allow for deferring by a set time, and there is no guarantee the call will happen immediately. It happens at the next core event pump. This is commonly used to execute UI messages. This module really needs better documentation, I'm concerned that it's usage doesn't follow the original intent.

@XLTechie
Copy link
Collaborator

XLTechie commented Mar 24, 2022 via email

@feerrenrut
Copy link
Contributor

Probably core.callLater is the approach you want, it allows for delays and handles running on the main thread.

UI.message will report (with speech and braille) a message. Speech can be interrupted by keyboard events (pressing any key), assuming that is what you mean by interruptable.

Why the (user-configured` delay? Can you give a solid example of the expected speech:
It sounds like you mean.

- User presses numpad 3 to move the review cursor by character
- NVDA reports the character `a`
- After a delay of X NVDA reports `alpha`

Why not report the character description immediately after the character?
E.G.

- User presses numpad 3 to move the review cursor by character
- NVDA reports the character `a  alpha`

@LittleStar-VIP
Copy link
Author

Why not report the character description immediately after the character?

As a user, I would like to speak on this issue.

  1. As this automatically speaking of character description doesn't apply just to English character, giving a delay allow user to clearly identify the character from the character description

  2. Also, I need not hear the character description of every character, e.g. a and c you will hardly mess up the two, but for p and b, m and n you may have the possibility of missing out the character at the first glance, so, if I want to hear the character description I will stop and wait for some seconds, if otherwise, it may be speaking too much info for each character.

@derekriemer
Copy link
Collaborator

I implemented this and I did it with speech commands, specifically the BreakCommand. There are two clear advantages to this:

  1. Speech functionality doesn't have to do any funky callLater or anything, it can simply emit more commands into the speech sequence.
  2. Other speech or pressing control naturally stops this utterance from happening, so it won't talk later if you pressed control to shut NVDA up.

@davidacm
Copy link
Contributor

BreakCommand sounds as a good aproach, but... That ensures that it will work with any synth driver? Even if BreakCommand is not supported in some driver?
Some synth drivers don't support this, or are not accurate in time.

I know, native drivers support it, but there are many external synth drivers used by users.

My current add-on can cancel the timer if another event occurs, even if the user press the control key.

@derekriemer
Copy link
Collaborator

#13543

@feerrenrut
Copy link
Contributor

As this automatically speaking of character description doesn't apply just to English character, giving a delay allow user to clearly identify the character from the character description

@LittleStar-VIP I understand. I think there are a few ways to achieve this with speech commands / sequences. The approach you use will depend on the scale of the delay required. Most speech separates concepts (E.G. A role description from the accessible name) with a double space. The synthesizer announces this with a slightly longer pause than between words.

As @derekriemer mentions the BreakCommand is potentially a solution. Either way, I think that speech commands are the right way to solve this issue.

Some synth drivers don't support this, or are not accurate in time.

@davidacm this may be a concern, it would be possible to implement this on the NVDA side generically.

@davidacm
Copy link
Contributor

I started to coding when I said I'd do it, based on my add-on EnhancedPhoneticReading but I hadn't had time to update the guide.

I sent the pr now. You can see it in This link

Use breakCommands could be a good idea, but it will need a distinct way from NVDA to handle the breakCommands and I don't think that it will be changed in short term.

@cary-rowen
Copy link
Contributor

@LittleStar-VIP
Have you tested #13550 and if so, any ideas?

@LittleStar-VIP
Copy link
Author

@cary-rowen
Thanks for your reminder, I have tested it and forgot to report to you here.
I think the function that the pr build is demonstrating is satisfactory.

seanbudd pushed a commit that referenced this issue Jul 19, 2022
Closes #13509

Summary of the issue:
The main use case is navigating character by character and a user encounters a character that they do not understand. The delayed phonetic character description is something like “alpha”/“beta”/“romeo”/“igloo”.

What makes understanding a character difficult?
This may be because a synthesizer pronounces a character unusually or indistinguishable from another character.
A user may also be hearing impaired or have other trouble processing the character. In this case, the user waits for the delayed phonetic description to occur.

Other ways to report the character description:
- script_review_currentCharacter
- script_review_currentWord
- script_review_currentLine
- script_reportCurrentLine

What makes determining the delay difficult?
The main determinate of the delay is the speed that a user interacts with the device, e.g. speed of navigating by character.
NVDA currently does not have a way to configure interaction rate, which is a general problem described in #13915.

Meeting auditory processing needs is generally achieved by adjusting the synthesizer rate.
Unfortunately, synthesizer rate varies by synthesizer, and so calculating a delay based on rate is challenging.

While a general solution for the interaction rate is blocked by #13915, using a sensible default will handle most users requirements. This delay can be configured easily by add-ons.

Description of user facing changes
Adds an option, which when enabled, causes character descriptions to be announced after a fixed delay of 1 second.
This delay value has been tested as a default in the “Enhanced phonetic reading” Add-on.

Description of development
This code modifies getTextInfoSpeech to emit a BreakCommand followed by several commands to speak a character description. This only happens if the unit of resolution is a single character, and the reason for querying for textInfo speech is caret. This causes NVDA to emit character descriptions in the following conditions:

when moving by character in an edit field.
When moving by character in review cursors.
When moving by character in browse mode.
When reporting single characters at review cursor.
Any other time that caret movement is being reported for single characters.
This solution also reads the character description with capitalization settings.

Using the BreakCommand means that the overall approach is simpler as opposed to using a timer, and handled by the synthesizer rather than NVDA.
@nvaccessAuto nvaccessAuto modified the milestone: 2022.3 Jul 19, 2022
@derekriemer
Copy link
Collaborator

I think the user guide should explain how long the delay is with the checkbox.

@derekriemer
Copy link
Collaborator

and the what's new.

@seanbudd
Copy link
Member

@derekriemer The User Guide currently contains a reference to the delay time:

For example, while reviewing a line by characters, when the letter "b" is read NVDA will say "Bravo" after a 1 second delay.

@derekriemer
Copy link
Collaborator

derekriemer commented Jul 19, 2022 via email

@MertKaraguzel
Copy link

Hi, I'm so glad that the delayed character descriptions feature is included in NVDA.
It would be nice if the ability to read delayed character descriptions in a shorter time could be added to this feature.
Thanks,

@MertKaraguzel
Copy link

MertKaraguzel commented Oct 5, 2022

Hello again, also, one more feature can be added.
It is also the feature of turning off the character feature in character descriptions and hearing only the descriptions.
example: Not a-alfa, not b-bravo.
Only alfa, bravo, Charlie like this.
This feature is available in the Enhanced Character Descriptions add-on.
Thanks.

@bdorer
Copy link

bdorer commented Oct 11, 2022 via email

@CyrilleB79
Copy link
Collaborator

@MertKaraguzelcommented and @bdorer, if you want your comments to be taken into account, you'd better open a new issue or comment in an existing matching open issue (if any).
Indeed, closed/resolved issues are less visible by NVAccess and are not triaged again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.