Skip to content

Repository files navigation

Enhanced Duck

Enhanced Duck is an NVDA add-on that extends NVDA's audio ducking with two focus-aware modes. In addition to NVDA's built-in modes, it can automatically lower the volume of other running applications based on which window is focused.

Modes

Press NVDA+shift+d to cycle through the available ducking modes:

  • No ducking
  • Duck when outputting speech and sounds
  • Always duck
  • Duck inactive applications
  • Duck the active application

The first three are NVDA's standard ducking modes. The last two are added by this add-on:

  • Duck inactive applications lowers the audio of every application that is not currently focused, so the app you are working in stays at full volume.
  • Duck the active application lowers the audio of the application that is currently focused, leaving background audio (for example, music) at full volume.

As focus moves between applications, the add-on continually updates which audio sessions are lowered, and it restores every application's original volume when you leave the mode or disable ducking. NVDA's own speech and sounds are never lowered.

The mode can also be chosen from NVDA Menu > Preferences > Settings > Audio, in the Audio ducking mode combo box (the two new entries appear at the end of the list). Changing configuration profiles is respected as well.

How the focus-aware modes work

The two extra modes are built on the Windows Core Audio session API. The add-on adjusts the per-application volume that Windows exposes in its volume mixer, so ducking works independently of NVDA's built-in WASAPI ducking and does not require an installed copy or UI access.

Because Windows groups audio by process, keep the following in mind:

  • An application is only affected while it has an active audio session (that is, while it is actually producing sound).
  • Some applications play audio from a helper process that is different from the focused window (web browsers are a common example). In that case the audio may not be matched to the focused window, and the mode may not behave as expected for that application.

Building

Install the NVDA add-on build requirements, then run:

scons

The generated enhancedDuck-<version>.nvda-addon file uses metadata from buildVars.py and documentation from this readme.md.

Store notes

The manifest metadata follows the current Add-on Store validation shape: a unique alphanumeric add-on name, a semantic major.minor.patch version, and valid NVDA API versions for minimumNVDAVersion and lastTestedNVDAVersion.

Before publishing, set a real HTTPS project or support URL in the addon_url value in buildVars.py.

About

Focus-aware audio ducking modes for NVDA (duck active or inactive applications)

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages