Make Factory get Mimic TTS class from normal list

Removes duplicated code and makes method easier to test
pull/2450/head
Åke Forslund 2020-01-10 16:25:28 +01:00
parent 72adf0465b
commit 391b92ce56
1 changed files with 2 additions and 2 deletions

View File

@ -513,8 +513,8 @@ class TTSFactory:
if tts_module != 'mimic':
LOG.exception('The selected TTS backend couldn\'t be loaded. '
'Falling back to Mimic')
from mycroft.tts.mimic_tts import Mimic
tts = Mimic(tts_lang, tts_config)
clazz = TTSFactory.CLASSES.get('mimic')
tts = clazz(tts_lang, tts_config)
tts.validator.validate()
else:
LOG.exception('The TTS could not be loaded.')