diff --git a/mimic3_http/app.py b/mimic3_http/app.py index 10b968f..d8bc6d4 100644 --- a/mimic3_http/app.py +++ b/mimic3_http/app.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # Copyright 2022 Mycroft AI Inc. # # This program is free software: you can redistribute it and/or modify diff --git a/mimic3_http/synthesis.py b/mimic3_http/synthesis.py index a9eb356..73bc899 100644 --- a/mimic3_http/synthesis.py +++ b/mimic3_http/synthesis.py @@ -1,4 +1,18 @@ -#!/usr/bin/env python3 +# Copyright 2022 Mycroft AI Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# import argparse import asyncio import io @@ -117,7 +131,7 @@ def do_synthesis_proc(args: argparse.Namespace, request_queue: Queue): _LOGGER.exception("Error during inference") # Signal error on main loop - asyncio.get_event_loop().call_soon_threadsafe( + item.loop.call_soon_threadsafe( item.future.set_exception, e ) diff --git a/mimic3_tts/utils.py b/mimic3_tts/utils.py index 47d8199..21d0752 100644 --- a/mimic3_tts/utils.py +++ b/mimic3_tts/utils.py @@ -23,6 +23,36 @@ import numpy as np WILDCARD = "*" +LANG_NAMES = { + "bn": ("বাংলা", "Bengali"), + "af_ZA": "Afrikaans", + "da_DK": ("Dansk", "Danish"), + "de_DE": ("Deutsch", "German"), + "en_UK": "English", + "en_US": "English", + "el_GR": ("Ελληνικά", "Greek"), + "es_ES": ("Español", "Spanish"), + "fa": ("فارسی", "Persian"), + "fi_FI": ("Suomi", "Finnish"), + "fr_FR": ("Français", "French"), + "gu_IN": ("ગુજરાતી", "Gujarati"), + "ha_NE": "Hausa", + "hu_HU": ("Magyar Nyelv", "Hungarian"), + "it_IT": ("Italiano", "Italian"), + "jv_ID": ("Basa Jawa", "Javanese"), + "ko_KO": ("한국어", "Korean"), + "ne_NP": ("नेपाली", "Nepali"), + "nl": ("Nederlands", "Dutch"), + "pl_PL": ("Polski", "Polish"), + "ru_RU": ("Русский", "Russian"), + "sw": "Kiswahili", + "te_IN": ("తెలుగు", "Telugu"), + "tn_ZA": "Setswana", + "uk_UK": ("украї́нська мо́ва", "Ukrainian"), + "vi_VN": ("Tiếng Việt", "Vietnamese"), + "yo": ("Èdè Yorùbá", "Yoruba"), +} + def audio_float_to_int16( audio: np.ndarray, max_wav_value: float = 32767.0