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': if tts_module != 'mimic':
LOG.exception('The selected TTS backend couldn\'t be loaded. ' LOG.exception('The selected TTS backend couldn\'t be loaded. '
'Falling back to Mimic') 'Falling back to Mimic')
from mycroft.tts.mimic_tts import Mimic clazz = TTSFactory.CLASSES.get('mimic')
tts = Mimic(tts_lang, tts_config) tts = clazz(tts_lang, tts_config)
tts.validator.validate() tts.validator.validate()
else: else:
LOG.exception('The TTS could not be loaded.') LOG.exception('The TTS could not be loaded.')