@@ -3062,11 +3062,26 @@ def __init__(self, parent):
30623062 wx .CheckBox (audioBox , label = label )
30633063 )
30643064 self .bindHelpEvent ("WASAPI" , self .wasapiCheckBox )
3065+ self .wasapiCheckBox .Bind (wx .EVT_CHECKBOX , self .onWasapiChange )
30653066 self .wasapiCheckBox .SetValue (
30663067 config .conf ["audio" ]["wasapi" ]
30673068 )
30683069 self .wasapiCheckBox .defaultValue = self ._getDefaultValue (
30693070 ["audio" , "wasapi" ])
3071+ # Translators: This is the label for a checkbox control in the
3072+ # Advanced settings panel.
3073+ label = _ ("Volume of NVDA sounds follows voice volume (requires WASAPI)" )
3074+ self .soundVolFollowCheckBox : wx .CheckBox = audioGroup .addItem (
3075+ wx .CheckBox (audioBox , label = label )
3076+ )
3077+ self .bindHelpEvent ("SoundVolumeFollowsVoice" , self .soundVolFollowCheckBox )
3078+ self .soundVolFollowCheckBox .SetValue (
3079+ config .conf ["audio" ]["soundVolumeFollowsVoice" ]
3080+ )
3081+ self .soundVolFollowCheckBox .defaultValue = self ._getDefaultValue (
3082+ ["audio" , "soundVolumeFollowsVoice" ])
3083+ if not self .wasapiCheckBox .GetValue ():
3084+ self .soundVolFollowCheckBox .Disable ()
30703085
30713086 # Translators: This is the label for a group of advanced options in the
30723087 # Advanced settings panel
@@ -3129,6 +3144,9 @@ def onOpenScratchpadDir(self,evt):
31293144 path = config .getScratchpadDir (ensureExists = True )
31303145 os .startfile (path )
31313146
3147+ def onWasapiChange (self , evt ):
3148+ self .soundVolFollowCheckBox .Enable (evt .IsChecked ())
3149+
31323150 def _getDefaultValue (self , configPath ):
31333151 return config .conf .getConfigValidation (configPath ).default
31343152
@@ -3156,6 +3174,7 @@ def haveConfigDefaultsBeenRestored(self):
31563174 and self .caretMoveTimeoutSpinControl .GetValue () == self .caretMoveTimeoutSpinControl .defaultValue
31573175 and self .reportTransparentColorCheckBox .GetValue () == self .reportTransparentColorCheckBox .defaultValue
31583176 and self .wasapiCheckBox .GetValue () == self .wasapiCheckBox .defaultValue
3177+ and self .soundVolFollowCheckBox .GetValue () == self .soundVolFollowCheckBox .defaultValue
31593178 and set (self .logCategoriesList .CheckedItems ) == set (self .logCategoriesList .defaultCheckedItems )
31603179 and self .playErrorSoundCombo .GetSelection () == self .playErrorSoundCombo .defaultValue
31613180 and True # reduce noise in diff when the list is extended.
@@ -3182,6 +3201,7 @@ def restoreToDefaults(self):
31823201 self .caretMoveTimeoutSpinControl .SetValue (self .caretMoveTimeoutSpinControl .defaultValue )
31833202 self .reportTransparentColorCheckBox .SetValue (self .reportTransparentColorCheckBox .defaultValue )
31843203 self .wasapiCheckBox .SetValue (self .wasapiCheckBox .defaultValue )
3204+ self .soundVolFollowCheckBox .SetValue (self .soundVolFollowCheckBox .defaultValue )
31853205 self .logCategoriesList .CheckedItems = self .logCategoriesList .defaultCheckedItems
31863206 self .playErrorSoundCombo .SetSelection (self .playErrorSoundCombo .defaultValue )
31873207 self ._defaultsRestored = True
@@ -3213,6 +3233,7 @@ def onSave(self):
32133233 self .reportTransparentColorCheckBox .IsChecked ()
32143234 )
32153235 config .conf ["audio" ]["wasapi" ] = self .wasapiCheckBox .IsChecked ()
3236+ config .conf ["audio" ]["soundVolumeFollowsVoice" ] = self .soundVolFollowCheckBox .IsChecked ()
32163237 config .conf ["annotations" ]["reportDetails" ] = self .annotationsDetailsCheckBox .IsChecked ()
32173238 config .conf ["annotations" ]["reportAriaDescription" ] = self .ariaDescCheckBox .IsChecked ()
32183239 config .conf ["braille" ]["enableHidBrailleSupport" ] = self .supportHidBrailleCombo .GetSelection ()
0 commit comments