Skip to content

Commit 9395e86

Browse files
authored
Merge ace9eb4 into f700d56
2 parents f700d56 + ace9eb4 commit 9395e86

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

source/synthDriverHandler.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ def _getSynthDriver(name) -> SynthDriver:
396396

397397

398398
def getSynthList():
399+
from synthDrivers.silence import SynthDriver as SilenceSynthDriver
400+
399401
synthList = []
400402
# The synth that should be placed at the end of the list.
401403
lastSynth = None
@@ -409,7 +411,7 @@ def getSynthList():
409411
continue
410412
try:
411413
if synth.check():
412-
if synth.name == "silence":
414+
if synth.name == SilenceSynthDriver.name:
413415
lastSynth = (synth.name, synth.description)
414416
else:
415417
synthList.append((synth.name, synth.description))
@@ -445,6 +447,8 @@ def getSynthInstance(name, asDefault=False):
445447

446448

447449
def setSynth(name: Optional[str], isFallback: bool = False):
450+
from synthDrivers.silence import SynthDriver as SilenceSynthDriver
451+
448452
asDefault = False
449453
global _curSynth, _audioOutputDevice
450454
if name is None:
@@ -475,14 +479,15 @@ def setSynth(name: Optional[str], isFallback: bool = False):
475479
synthChanged.notify(synth=_curSynth, audioOutputDevice=_audioOutputDevice, isFallback=isFallback)
476480
return True
477481
# As there was an error loading this synth:
478-
elif prevSynthName:
482+
elif prevSynthName and not prevSynthName == SilenceSynthDriver.name:
483+
# Don't fall back to silence if speech is expected
479484
log.info(f"Falling back to previous synthDriver {prevSynthName}")
480485
# There was a previous synthesizer, so switch back to that one.
481486
setSynth(prevSynthName, isFallback=True)
482487
else:
483488
# There was no previous synth, so fallback to the next available default synthesizer
484489
# that has not been tried yet.
485-
log.info(f"Searching for next synthDriver")
490+
log.info("Searching for next synthDriver")
486491
findAndSetNextSynth(name)
487492
return False
488493

0 commit comments

Comments
 (0)