Repository: nvaccess/nvda

Issue:
Using delayed character descriptions, on each uppercase letter, a double beep is heard.
<!-- Please read the text in this edit field before filling it in.
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/blob/master/devDocs/githubIssueTemplateExplanationAndExamples.md
Please also note that the NVDA project has a Citizen and Contributor Code of Conduct which can be found at https://github.com/nvaccess/nvda/blob/master/CODE_OF_CONDUCT.md. NV Access expects that all contributors and other community members read and abide by the rules set out in this document while participating or contributing to this project. This includes creating or commenting on issues and pull requests. 

Each of the questions and sections below start with multiple hash symbols (#). Place your answers and information on the blank line below each question.
-->

### Steps to reproduce:
- in NVDA settings and  "speech" category check: Delayed descriptions for characters on cursor movement check box and  Beep for capitals check box.
- now review word with capital letters.
### Actual behavior:
<!--
Use "Speak command keys" (NVDA+4) and speech viewer to copy and paste here. 
Use braille viewer to copy and paste here.
You may additionally include an explanation.
-->
On each uppercase letter, a double beep is heard.
### Expected behavior:
<!--
Use "Speak command keys" (NVDA+4) and speech viewer to copy and paste here. 
Use braille viewer to copy and paste here.
You may additionally include an explanation.
-->
only a single beep should be heard
### NVDA logs, crash dumps and other attachments:

### System configuration
#### NVDA installed/portable/running from source:
nvda portable
#### NVDA version:
NVDA 2022.3  and alpha
#### Windows version:
Windows 10 21H1 (10.0.19043) workstation

#### Name and version of other software in use when reproducing the issue:
None
#### Other information about your system:
None
### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Same behavior
#### If NVDA add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes


Discussion:
The beep is issued once when the character is read and a second time one second later when its description is read. I agree that the first beep is enough.

Note that there are two other options related to cap reporting: "Capital pitch change percentage" and "Say cap before capitals". The same way, these two options operate twice: once when the character is reported and once one second later when the character description is reported. Do we expect that they operate for character description?

I would say that pitch change should operate as today, that is both when the character is reported and when its description is reported.
For the option "Say cap before", I have no opinion.

It would be good to have the feedback of people with hearing difficulties.


Exact.
But there is no beep for a lowercase letter although the description 
starts with an uppercase letter.
To solve the problem, I think that the description would have to be 
completely lowercase.

Le 12/10/2022 11:40, Cyrille Bougot a écrit :
>
> The beep is issued once when the character is read and a second time 
> one second later when its description is read. I agree that the first 
> beep is enough.
>
> Note that there are two other options related to cap reporting: 
> "Capital pitch change percentage" and "Say cap before capitals". The 
> same way, these two options operate twice: once when the character is 
> reported and once one second later when the character description is 
> reported. Do we expect that they operate for character description?
>
> I would say that pitch change should operate as today, that is both 
> when the character is reported and when its description is reported.
> For the option "Say cap before", I have no opinion.
>
> It would be good to have the feedback of people with hearing difficulties.
>
> —
> Reply to this email directly, view it on GitHub 
> <https://github.com/nvaccess/nvda/issues/14239#issuecomment-1275880614>, 
> or unsubscribe 
> <https://github.com/notifications/unsubscribe-auth/ADZLFFBEQJX6XT336MT5N33WC2BRBANCNFSM6AAAAAARDBPWZE>.
> You are receiving this because you authored the thread.Message ID: 
> ***@***.***>
>


> Exact. But there is no beep for a lowercase letter although the description starts with an uppercase letter. To solve the problem, I think that the description would have to be completely lowercase.

No, the case of the description does not matter. E.g. in French, you have "éco" and "youniform" with lower case and the other ones with upper case but the result is always the same. What matters is only the case of the character being described.


Yes, but that's even more disturbing.
Why and what does this second beep signal?

Le 12/10/2022 14:38, Cyrille Bougot a écrit :
>
>     Exact. But there is no beep for a lowercase letter although the
>     description starts with an uppercase letter. To solve the problem,
>     I think that the description would have to be completely lowercase.
>
> No, the case of the description does not matter. E.g. in French, you 
> have "éco" and "youniform" with lower case and the other ones with 
> upper case but the result is always the same. What matters is only the 
> case of the character being described.
>
> —
> Reply to this email directly, view it on GitHub 
> <https://github.com/nvaccess/nvda/issues/14239#issuecomment-1276101369>, 
> or unsubscribe 
> <https://github.com/notifications/unsubscribe-auth/ADZLFFB73CLZC2M7GSLD7LTWC2WMXANCNFSM6AAAAAARDBPWZE>.
> You are receiving this because you authored the thread.Message ID: 
> ***@***.***>
>


> Yes, but that's even more disturbing. Why and what does this second beep signal? 

The second beep just repeats the same information that was already provided by the first beep. Again, I agree with you. This second beep is useless and disturbing. It should be removed.

It would probably depend on the synth in use. I sometimes feel that the 
pitch is raised more obviously in Espeak than in most of the natural 
sounding voices. I am not hearing impaired, but one point has been made by 
some who are is that some beeps in nvda seem too high a pitch, but that is 
another issue.
 Brian

-- 
***@***.***
Sent via blueyonder.(Virgin media)
Please address personal E-mail to:-
***@***.***, putting 'Brian Gaff'
in the display name field.
----- Original Message ----- 
From: "Cyrille Bougot" ***@***.***>
To: "nvaccess/nvda" ***@***.***>
Cc: "Subscribed" ***@***.***>
Sent: Wednesday, October 12, 2022 10:40 AM
Subject: Re: [nvaccess/nvda] On each uppercase letter, a double beep is 
heard. (Issue #14239)


> The beep is issued once when the character is read and a second time one 
> second later when its description is read. I agree that the first beep is 
> enough.
>
> Note that there are two other options related to cap reporting: "Capital 
> pitch change percentage" and "Say cap before capitals". The same way, 
> these two options operate twice: once when the character is reported and 
> once one second later when the character description is reported. Do we 
> expect that they operate for character description?
>
> I would say that pitch change should operate as today, that is both when 
> the character is reported and when its description is reported.
> For the option "Say cap before", I have no opinion.
>
> It would be good to have the feedback of people with hearing difficulties.
>
>
>
> -- 
> Reply to this email directly or view it on GitHub:
> https://github.com/nvaccess/nvda/issues/14239#issuecomment-1275880614
> You are receiving this because you are subscribed to this thread.
>
> Message ID: ***@***.***> 



Resolving patch:
diff --git a/source/speech/speech.py b/source/speech/speech.py
--- a/source/speech/speech.py
+++ b/source/speech/speech.py
@@ -350,7 +350,7 @@ def _getSpellingSpeechWithoutCharMode(
 
 def getSingleCharDescriptionDelayMS() -> int:
 	"""
-	@returns: 1 second, a default delay.
+	@returns: 1 second, a default delay for delayed character descriptions.
 	In the future, this should fetch its value from a user defined NVDA idle time.
 	Blocked by: https://github.com/nvaccess/nvda/issues/13915
 	"""
@@ -361,12 +361,17 @@ def getSingleCharDescription(
 		text: str,
 		locale: Optional[str] = None,
 ) -> Generator[SequenceItemT, None, None]:
+	"""
+	Returns a speech sequence:
+	a pause, the length determined by getSingleCharDescriptionDelayMS,
+	followed by the character description.
+	"""
 	# This should only be used for single chars.
 	if not len(text) == 1:
 		return
 	synth = getSynth()
 	synthConfig = config.conf["speech"][synth.name]
-	if synth.isSupported("pitch"):
+	if synth.isSupported("pitch") and text.isupper():
 		capPitchChange = synthConfig["capPitchChange"]
 	else:
 		capPitchChange = 0
@@ -375,9 +380,18 @@ def getSingleCharDescription(
 		text,
 		locale,
 		useCharacterDescriptions=True,
-		sayCapForCapitals=text.isupper() and synthConfig["sayCapForCapitals"],
-		capPitchChange=(capPitchChange if text.isupper() else 0),
-		beepForCapitals=text.isupper() and synthConfig["beepForCapitals"],
+		# The pitch change may be useful,
+		# as a pitch change may be harder to notice,
+		# and continuing the shifted pitch
+		# is more intuitive.
+		capPitchChange=capPitchChange,
+		# #14239: When navigating by character,
+		# there is already a beep or "cap" announcement.
+		# There is no need for a secondary beep
+		# or "cap" announcement when announcing the
+		# the delayed character description.
+		beepForCapitals=False,
+		sayCapForCapitals=False,
 		fallbackToCharIfNoDescription=False,
 	)
 


Test patch: