nvda
20d5a25d - support audio ducking for SAPI5 on Windows 11 (#13118)

Commit
4 years ago
support audio ducking for SAPI5 on Windows 11 (#13118) 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).
Parents
Loading