File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import audioDucking
1515from synthDriverHandler import SynthDriver , VoiceInfo , synthIndexReached , synthDoneSpeaking
1616import config
17- import nvwave
1817from logHandler import log
1918import weakref
2019import languageHandler
@@ -205,9 +204,10 @@ def _initTts(self, voice=None):
205204 # Therefore, set the voice before setting the audio output.
206205 # Otherwise, we will get poor speech quality in some cases.
207206 self .tts .voice = voice
208- outputDeviceID = nvwave .outputDeviceNameToID (config .conf ["speech" ]["outputDevice" ], True )
209- if outputDeviceID >= 0 :
210- self .tts .audioOutput = self .tts .getAudioOutputs ()[outputDeviceID ]
207+ for audioOutput in self .tts .GetAudioOutputs ():
208+ if audioOutput .GetDescription () == config .conf ["speech" ]["outputDevice" ]:
209+ self .tts .audioOutput = audioOutput
210+ break
211211 self ._eventsConnection = comtypes .client .GetEvents (self .tts , SapiSink (weakref .ref (self )))
212212 self .tts .EventInterests = (
213213 SpeechVoiceEvents .StartInputStream | SpeechVoiceEvents .Bookmark | SpeechVoiceEvents .EndInputStream
You can’t perform that action at this time.
0 commit comments