Commit b0228fe
authored
Temporarily suspend audio ducking when a 32 bit synthDriver is in use (#19665)
Partial fix for #19618
### Summary of the issue:
As 32 bit sapi synthDrivers introduced in pr #19432 produce audio
directly in their own process, NVDA currently cannot correctly duck
audio when they are in use. Specifically, if NVDA is set to always duck,
the audio from these synths is ducked along with other external audio.
And if set to duck for speech and sounds, their audio does not cause
ducking, and any NvDA sound that does, ducks their audio.
The correct approach to fix this for the long-term is to broker all 32
bit audio through NVDA, rather than it being played directly by the
external process. See pr #19577. But until then, we should at least
consider tempoarily disabling audio ducking while one of these
synthDrivers is in use, so that its audio is not inappropriately ducked.
### Description of development approach:
* Added a new private `_AudioDuckingSuspender` class to `audioDucking`
which when at least one instance exists, temporarily suspends audio
ducking, and disallows changing the current audio ducking setting via
the gesture or GUI setting. When all instances are deleted, then audio
ducking is restored back to the state it was before one or more
instances were created.
* `_bridge`'s `SynthDriverProxy` class when instantiated now creates an
instance of `_AudioDuckingsuspender` and holds it on the
SynthDriverProxy instance, thus causing audio ducking to be temporarily
disabled while this synthDriver is in use.
### Testing strategy:
With a copy of NVDA that supports audio ducking:
* Using eSpeak, set audio ducking via the gesture to always duck.
Confirm that audio stays ducked.
* Choose the sapi 32 bit synth from the Select Synthesizer dialog.
Confirm that audio is no longer ducked.
* Try to cycle through audio ducking modes with `NVDA+shift+d`. Confirm
that NvDA reports that audio ducking is not supported.
* Go to the audio pannel in the NvDA settings dialog. Confirm that the
Audio ducking mode control is disabled.
* Choose eSpeak from the Selected synthesizer dialog. Confirm that audio
is again ducked.
* Try to cycle through the audio ducking modes with the gesture. Confirm
that this works.
* Confirm that the audio ducking mode in the Audio panel of the NvDA
settings dialog is no longer disabled.
### Known issues with pull request:
* This is a temporary partial fix that just ensures that audio ducking
is correctly disabled. The full fix is to broker audio and again fully
support audio ducking. PR #19432.
* An alternative would be to grant the 32 bit synthDriver runtime
process UIAccess and build audio ducking directly into it. However,
adding a second process with UIAccess would greatly increase our
possible attack surface, and is not moving in the direction of a secure
add-on runtime.1 parent 3291f42 commit b0228fe
4 files changed
Lines changed: 55 additions & 2 deletions
File tree
- source
- _bridge/components/proxies
- gui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3530 | 3530 | | |
3531 | 3531 | | |
3532 | 3532 | | |
3533 | | - | |
| 3533 | + | |
3534 | 3534 | | |
3535 | 3535 | | |
3536 | 3536 | | |
| |||
0 commit comments