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

No speech aware audio ducking with NVDA2021.2, Windows11 and SAPI 5 #12913

Closed
Herne89 opened this issue Oct 6, 2021 · 8 comments · Fixed by #13118
Closed

No speech aware audio ducking with NVDA2021.2, Windows11 and SAPI 5 #12913

Herne89 opened this issue Oct 6, 2021 · 8 comments · Fixed by #13118
Labels
component/audio NVDA's audio output (nvWave, issues with usb audio etc). platform/Windows11 Issues specific to Windows 11
Milestone

Comments

@Herne89
Copy link

Herne89 commented Oct 6, 2021

Steps to reproduce:

  1. Set your synth driver to a Microsoft Speech ApI 5 voice, with audio ducking enabled for sounds/speech.
  2. Play a constant sound with constant volume (eg music)
  3. Use your computer, note that audio ducking does not occur when speech occurs

Actual behavior:

Audio does not duck on speech

Expected behavior:

Audio ducks on speech

System configuration

NVDA installed/portable/running from source:

NVDA version:

Present in alpha-23874,d8dc04c7, NVDA 2021.2

Windows version:

Windows 11 22000.194

Name and version of other software in use when reproducing the issue:

Other information about your system:

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.

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

@seanbudd
Copy link
Member

seanbudd commented Oct 7, 2021

Can confirm with NVDA 2021.2 and Windows 11.

@seanbudd seanbudd added this to the 2021.3 milestone Oct 7, 2021
@feerrenrut feerrenrut added component/audio NVDA's audio output (nvWave, issues with usb audio etc). platform/Windows11 Issues specific to Windows 11 labels Oct 7, 2021
@feerrenrut
Copy link
Contributor

Please can you (or @seanbudd) update this with whatever information you can to fill out the template. Are there any error messages in the NVDA log (please attach them)?

@Herne89
Copy link
Author

Herne89 commented Oct 7, 2021 via email

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Oct 7, 2021

i'd like to add that audio ducking does work when set to always duck.

@seanbudd
Copy link
Member

seanbudd commented Oct 8, 2021

Can confirm there is no log in relation to audioducking, it also seems that automatic language switching is not supported (not sure if this is a new issue with this synth).

DEBUGWARNING - synthDrivers.sapi5.SynthDriver.speak (12:56:29.760) - MainThread (2632):
Unsupported speech command: LangChangeCommand ('en_US')

@seanbudd
Copy link
Member

seanbudd commented Oct 8, 2021

There's no advanced audioducking logging whatsoever either when using that synth

@Herne89
Copy link
Author

Herne89 commented Oct 9, 2021 via email

@seanbudd seanbudd changed the title NVDA2021.2 Windows11 and Microsoft speech API 5 No speech aware audio ducking with NVDA2021.2, Windows11 and SAPI 5 Oct 12, 2021
@seanbudd seanbudd modified the milestones: 2021.3, 2022.1 Oct 12, 2021
@seanbudd
Copy link
Member

This is due to Windows 11 changing how SAPI 5 outputs audio. NVDA detects SAPI5 output to duck.
Finding an alternative mechanism to detect SAPI5 audio output is unlikely to be done in time for 2021.3.

michaelDCurran added a commit that referenced this issue Jan 12, 2022
Fixes #12913

Summary of the issue:
NVDA's SAPI5 synthDriver instructed Windows to duck and unduck background audio via hooked winmm waveOut functions. However, on Windows 11, it seems that these functions are no longer used by SAPI5, and therefore audio ducking no longer worked for SAPI5.

Description of how this pull request fixes the issue:
Rather than hooking winmm functions, instead make use of SAPI5's own events, and other SynthDriver methods to enable and disable ducking.
Specifically:
* On SAPISink.StartStream: enable ducking
* On SAPISink.EndStream: disable ducking
* SynthDriver.cancel: disable ducking
* SynthDriver.pause: disable ducking if pausing and enable ducking if unpausing.
* SynthDriver.speak: temporarily enable audio ducking around the call to speak so that audio ducking can enforce its initial delay before speaking (as StartStream and EndStream are asynchronous).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/audio NVDA's audio output (nvWave, issues with usb audio etc). platform/Windows11 Issues specific to Windows 11
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants