From 0c8aa414f233795bbc5a2c860d1c2a958f7fb42b Mon Sep 17 00:00:00 2001 From: mltony Date: Thu, 18 Apr 2024 14:48:41 -0700 Subject: [PATCH] Fixing #16409 --- source/globalCommands.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/globalCommands.py b/source/globalCommands.py index 0cb33a02bd8..40c9a74a326 100755 --- a/source/globalCommands.py +++ b/source/globalCommands.py @@ -68,6 +68,7 @@ import vision from utils.security import objectBelowLockScreenAndWindowsIsLocked import audio +import nvwave #: Script category for text review commands. @@ -4520,6 +4521,14 @@ def script_cycleSoundSplit(self, gesture: "inputCore.InputGesture") -> None: gesture="kb:NVDA+alt+pageUp", ) def script_increaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -> None: + if not nvwave.usingWasapiWavePlayer(): + message = _( + # Translators: error message when wasapi is turned off. + "Cannot adjust volume of other applications. " + "Please enable WASAPI in the Advanced category in NVDA Settings to use it." + ) + ui.message(message) + return state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"]) if state == audio.soundSplit.SoundSplitState.OFF: # Translators: An error message while trying to adjust applications volume @@ -4544,6 +4553,14 @@ def script_increaseApplicationsVolume(self, gesture: "inputCore.InputGesture") - gesture="kb:NVDA+alt+pageDown", ) def script_decreaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -> None: + if not nvwave.usingWasapiWavePlayer(): + message = _( + # Translators: error message when wasapi is turned off. + "Cannot adjust volume of other applications. " + "Please enable WASAPI in the Advanced category in NVDA Settings to use it." + ) + ui.message(message) + return state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"]) if state == audio.soundSplit.SoundSplitState.OFF: # Translators: An error message while trying to adjust applications volume @@ -4568,6 +4585,14 @@ def script_decreaseApplicationsVolume(self, gesture: "inputCore.InputGesture") - gesture="kb:NVDA+alt+delete", ) def script_toggleApplicationsMute(self, gesture: "inputCore.InputGesture") -> None: + if not nvwave.usingWasapiWavePlayer(): + message = _( + # Translators: error message when wasapi is turned off. + "Cannot mute other applications. " + "Please enable WASAPI in the Advanced category in NVDA Settings to use it." + ) + ui.message(message) + return state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"]) if state == audio.soundSplit.SoundSplitState.OFF: # Translators: An error message while trying to adjust applications volume