def create(module=None):
     module = module or "amazon"
     config = get_neon_lang_config()
     module = module or config.get("translation_module", "google")
     # TODO: Check file locations DM
     if module == "amazon" \
             and get_neon_tts_config()["amazon"].get("aws_access_key_id", "") == "":
         from neon_utils.authentication_utils import find_neon_aws_keys, populate_amazon_keys_config
         try:
             config_keys = find_neon_aws_keys()
             populate_amazon_keys_config(config_keys)
         except FileNotFoundError:
             LOG.debug("Amazon credentials not available")
             module = "google"
         except Exception as e:
             LOG.error(e)
             module = "google"
     try:
         clazz = TranslatorFactory.CLASSES.get(module)
         return clazz()
     except Exception as e:
         # The translate backend failed to start. Report it and fall back to
         # default.
         LOG.exception(
             'The selected translator backend could not be loaded, '
             'falling back to default...')
         LOG.error(e)
         if module != 'google':
             return GoogleTranslator()
         else:
             raise
 def __init__(self, lang="en-us", config=None):
     config = config or get_neon_tts_config().get("mozilla", {})
     super(MozillaRemoteTTS, self).__init__(lang,
                                            config,
                                            MozillaTTSValidator(self),
                                            audio_ext="mp3",
                                            ssml_tags=["speak"])
     self.base_url = config.get("api_url", "http://0.0.0.0:5002/api/tts")
 def __init__(self):
     super().__init__()
     # TODO: Replace private key function DM
     # self.keys = get_private_keys()["amazon"]
     self.keys = get_neon_tts_config()["amazon"]
     self.client = boto3.Session(
         aws_access_key_id=self.keys["aws_access_key_id"],
         aws_secret_access_key=self.keys["aws_secret_access_key"],
         region_name=self.keys["region"]).client('translate')
 def __init__(self, lang="en-us", config=None):
     config = config or get_neon_tts_config().get("mozilla_local", {})
     super(MozillaLocalTTS, self).__init__(lang,
                                           config,
                                           MozillaTTSValidator(self),
                                           audio_ext="mp3",
                                           ssml_tags=["speak"])
     self.manager = ModelManager()
     self.models = self.manager.list_models()
     self.preferred_model = config.get("preferred_model", "tacotron2-DDC")
     self._get_synthesizer(
         lang)  # Make sure we have a model available in init