Skip to content

Commit 61e6454

Browse files
authored
Merge d86a9e1 into 03033ba
2 parents 03033ba + d86a9e1 commit 61e6454

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

source/synthDriverHandler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import speechDictHandler
1919
import extensionPoints
2020
import synthDrivers
21+
from synthDrivers.silence import SynthDriver as SilenceSynthDriver
2122
import driverHandler
2223
from autoSettingsUtils.driverSetting import BooleanDriverSetting, DriverSetting, NumericDriverSetting
2324
from autoSettingsUtils.utils import StringParameterInfo
@@ -409,7 +410,7 @@ def getSynthList():
409410
continue
410411
try:
411412
if synth.check():
412-
if synth.name == "silence":
413+
if synth.name == SilenceSynthDriver.name:
413414
lastSynth = (synth.name, synth.description)
414415
else:
415416
synthList.append((synth.name, synth.description))
@@ -475,14 +476,15 @@ def setSynth(name: Optional[str], isFallback: bool = False):
475476
synthChanged.notify(synth=_curSynth, audioOutputDevice=_audioOutputDevice, isFallback=isFallback)
476477
return True
477478
# As there was an error loading this synth:
478-
elif prevSynthName:
479+
elif prevSynthName and not prevSynthName == SilenceSynthDriver.name:
480+
# Don't fall back to silence if speech is expected
479481
log.info(f"Falling back to previous synthDriver {prevSynthName}")
480482
# There was a previous synthesizer, so switch back to that one.
481483
setSynth(prevSynthName, isFallback=True)
482484
else:
483485
# There was no previous synth, so fallback to the next available default synthesizer
484486
# that has not been tried yet.
485-
log.info(f"Searching for next synthDriver")
487+
log.info("Searching for next synthDriver")
486488
findAndSetNextSynth(name)
487489
return False
488490

0 commit comments

Comments
 (0)