@@ -1109,6 +1109,24 @@ def makeSettings(self, settingsSizer):
11091109 self .bindHelpEvent ("SelectSynthesizerSynthesizer" , self .synthList )
11101110 self .updateSynthesizerList ()
11111111
1112+ # Translators: This is the label for the select output
1113+ # device combo in the synthesizer dialog. Examples of
1114+ # of an output device are default soundcard, usb
1115+ # headphones, etc.
1116+ deviceListLabelText = _ ("Audio output &device:" )
1117+ deviceNames = nvwave .getOutputDeviceNames ()
1118+ # #11349: On Windows 10 20H1 and 20H2, Microsoft Sound Mapper returns an empty string.
1119+ if deviceNames [0 ] in ("" , "Microsoft Sound Mapper" ):
1120+ # Translators: name for default (Microsoft Sound Mapper) audio output device.
1121+ deviceNames [0 ] = _ ("Microsoft Sound Mapper" )
1122+ self .deviceList = settingsSizerHelper .addLabeledControl (deviceListLabelText , wx .Choice , choices = deviceNames )
1123+ self .bindHelpEvent ("SelectSynthesizerOutputDevice" , self .deviceList )
1124+ try :
1125+ selection = deviceNames .index (config .conf ["speech" ]["outputDevice" ])
1126+ except ValueError :
1127+ selection = 0
1128+ self .deviceList .SetSelection (selection )
1129+
11121130 def postInit (self ):
11131131 # Finally, ensure that focus is on the synthlist
11141132 self .synthList .SetFocus ()
@@ -1130,9 +1148,13 @@ def onOk(self, evt):
11301148 # The list of synths has not been populated yet, so we didn't change anything in this panel
11311149 return
11321150
1151+ config .conf ["speech" ]["outputDevice" ]= self .deviceList .GetStringSelection ()
11331152 newSynth = self .synthNames [self .synthList .GetSelection ()]
11341153 if not setSynth (newSynth ):
1135- _synthWarningDialog (newSynth .name )
1154+ # Translators: This message is presented when
1155+ # NVDA is unable to load the selected
1156+ # synthesizer.
1157+ gui .messageBox (_ ("Could not load the %s synthesizer." )% newSynth ,_ ("Synthesizer Error" ),wx .OK | wx .ICON_WARNING ,self )
11361158 return
11371159
11381160 # Reinitialize the tones module to update the audio device
0 commit comments