Temporarily suspend audio ducking when a 32 bit synthDriver is in use#19665
Merged
Conversation
…, as these synths currently produce audio from a separate process which can't duck and is inappropriatley cucked itself.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a temporary suspension mechanism for audio ducking when 32-bit synthesizer drivers are in use. Since these drivers play audio directly in their own process (introduced in PR #19432), NVDA cannot correctly manage audio ducking for them. This is a temporary workaround until audio can be properly brokered through NVDA (planned for PR #19577).
Changes:
- Added
_AudioDuckingSuspenderclass with reference counting to temporarily disable audio ducking - Updated UI and keyboard shortcuts to indicate audio ducking is unsupported when suspended
- Integrated suspender into
SynthDriverProxyto automatically suspend ducking when 32-bit synth drivers are active
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| source/audioDucking.py | Implements _AudioDuckingSuspender class with reference counting mechanism and suspension check function |
| source/gui/settingsDialogs.py | Disables audio ducking mode control in settings when audio ducking is suspended |
| source/globalCommands.py | Prevents cycling through audio ducking modes via keyboard gesture when suspended |
| source/_bridge/components/proxies/synthDriver.py | Creates audio ducking suspender instance when proxied synth driver is initialized |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SaschaCowley
approved these changes
Feb 23, 2026
5 tasks
seanbudd
pushed a commit
that referenced
this pull request
Feb 26, 2026
Follow-up to #19665 Summary of the issue: #19665 prevents audio ducking when using a proxied SAPI4 or SAPI 5 speech synth, as it does not work correctly on betas due to the synth outputting sound out of process. However, as alpha builds broker the audio from from the 32-bit host process and output it in process, audio ducking works correctly. Description of user facing changes: Audio ducking again works on alpha builds when using a SAPI 4 or 32-bit SAPI 5 synth. Description of developer facing changes: None Description of development approach: Reverted the changes to source/_bridge/components/proxies/synthDriver.py introduced in b0228fe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
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 user facing changes:
Description of developer facing changes:
Description of development approach:
_AudioDuckingSuspenderclass toaudioDuckingwhich 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'sSynthDriverProxyclass when instantiated now creates an instance of_AudioDuckingsuspenderand 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:
NVDA+shift+d. Confirm that NvDA reports that audio ducking is not supported.Known issues with pull request:
Code Review Checklist: