#
# Retrieved from get_listvoice.py using API
#

AZURE_VOICES = [
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ar-EG, Hoda)",
        "ShortName": "ar-EG-Hoda",
        "Gender": "Female",
        "Locale": "ar-EG"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ar-SA, Naayf)",
        "ShortName": "ar-SA-Naayf",
        "Gender": "Male",
        "Locale": "ar-SA"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (bg-BG, Ivan)",
        "ShortName": "bg-BG-Ivan",
        "Gender": "Male",
        "Locale": "bg-BG"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ca-ES, HerenaRUS)",
        "ShortName": "ca-ES-HerenaRUS",
        "Gender": "Female",
        "Locale": "ca-ES"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (cs-CZ, Jakub)",
        "ShortName": "cs-CZ-Jakub",
        "Gender": "Male",
        "Locale": "cs-CZ"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (da-DK, HelleRUS)",
        "ShortName": "da-DK-HelleRUS",
        "Gender": "Female",
        "Locale": "da-DK"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-AT, Michael)",
        "ShortName": "de-AT-Michael",
        "Gender": "Male",
        "Locale": "de-AT"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-CH, Karsten)",
        "ShortName": "de-CH-Karsten",
        "Gender": "Male",
        "Locale": "de-CH"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-DE, Hedda)",
        "ShortName": "de-DE-Hedda",
        "Gender": "Female",
        "Locale": "de-DE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-DE, HeddaRUS)",
        "ShortName": "de-DE-HeddaRUS",
        "Gender": "Female",
        "Locale": "de-DE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-DE, Stefan, Apollo)",
        "ShortName": "de-DE-Stefan-Apollo",
        "Gender": "Male",
        "Locale": "de-DE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (el-GR, Stefanos)",
        "ShortName": "el-GR-Stefanos",
        "Gender": "Male",
        "Locale": "el-GR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-AU, Catherine)",
        "ShortName": "en-AU-Catherine",
        "Gender": "Female",
        "Locale": "en-AU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-AU, HayleyRUS)",
        "ShortName": "en-AU-HayleyRUS",
        "Gender": "Female",
        "Locale": "en-AU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-CA, Linda)",
        "ShortName": "en-CA-Linda",
        "Gender": "Female",
        "Locale": "en-CA"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-CA, HeatherRUS)",
        "ShortName": "en-CA-HeatherRUS",
        "Gender": "Female",
        "Locale": "en-CA"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-GB, George, Apollo)",
        "ShortName": "en-GB-George-Apollo",
        "Gender": "Male",
        "Locale": "en-GB"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-GB, HazelRUS)",
        "ShortName": "en-GB-HazelRUS",
        "Gender": "Female",
        "Locale": "en-GB"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-GB, Susan, Apollo)",
        "ShortName": "en-GB-Susan-Apollo",
        "Gender": "Female",
        "Locale": "en-GB"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-GB, LibbyNeural)",
        "ShortName": "en-GB-LibbyNeural",
        "Gender": "Female",
        "Locale": "en-GB"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-IE, Sean)",
        "ShortName": "en-IE-Sean",
        "Gender": "Male",
        "Locale": "en-IE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-IN, Heera, Apollo)",
        "ShortName": "en-IN-Heera-Apollo",
        "Gender": "Female",
        "Locale": "en-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-IN, PriyaRUS)",
        "ShortName": "en-IN-PriyaRUS",
        "Gender": "Female",
        "Locale": "en-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-IN, Ravi, Apollo)",
        "ShortName": "en-IN-Ravi-Apollo",
        "Gender": "Male",
        "Locale": "en-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, BenjaminRUS)",
        "ShortName": "en-US-BenjaminRUS",
        "Gender": "Male",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, Guy24kRUS)",
        "ShortName": "en-US-Guy24kRUS",
        "Gender": "Male",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)",
        "ShortName": "en-US-JessaRUS",
        "Gender": "Female",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, Jessa24kRUS)",
        "ShortName": "en-US-Jessa24kRUS",
        "Gender": "Female",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)",
        "ShortName": "en-US-ZiraRUS",
        "Gender": "Female",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-ES, HelenaRUS)",
        "ShortName": "es-ES-HelenaRUS",
        "Gender": "Female",
        "Locale": "es-ES"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-ES, Laura, Apollo)",
        "ShortName": "es-ES-Laura-Apollo",
        "Gender": "Female",
        "Locale": "es-ES"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-ES, Pablo, Apollo)",
        "ShortName": "es-ES-Pablo-Apollo",
        "Gender": "Male",
        "Locale": "es-ES"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-MX, HildaRUS)",
        "ShortName": "es-MX-HildaRUS",
        "Gender": "Female",
        "Locale": "es-MX"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-MX, Raul, Apollo)",
        "ShortName": "es-MX-Raul-Apollo",
        "Gender": "Male",
        "Locale": "es-MX"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fi-FI, HeidiRUS)",
        "ShortName": "fi-FI-HeidiRUS",
        "Gender": "Female",
        "Locale": "fi-FI"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fr-CA, Caroline)",
        "ShortName": "fr-CA-Caroline",
        "Gender": "Female",
        "Locale": "fr-CA"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fr-CA, HarmonieRUS)",
        "ShortName": "fr-CA-HarmonieRUS",
        "Gender": "Female",
        "Locale": "fr-CA"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fr-CH, Guillaume)",
        "ShortName": "fr-CH-Guillaume",
        "Gender": "Male",
        "Locale": "fr-CH"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fr-FR, DeniseNeural)",
        "ShortName": "fr-FR-DeniseNeural",
        "Gender": "Female",
        "Locale": "fr-FR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (fr-FR, HenriNeural)",
        "ShortName": "fr-FR-HenriNeural",
        "Gender": "Male",
        "Locale": "fr-FR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (he-IL, Asaf)",
        "ShortName": "he-IL-Asaf",
        "Gender": "Male",
        "Locale": "he-IL"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (hi-IN, Hemant)",
        "ShortName": "hi-IN-Hemant",
        "Gender": "Male",
        "Locale": "hi-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (hi-IN, Kalpana, Apollo)",
        "ShortName": "hi-IN-Kalpana-Apollo",
        "Gender": "Female",
        "Locale": "hi-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (hi-IN, Kalpana)",
        "ShortName": "hi-IN-Kalpana",
        "Gender": "Female",
        "Locale": "hi-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (hr-HR, Matej)",
        "ShortName": "hr-HR-Matej",
        "Gender": "Male",
        "Locale": "hr-HR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (hu-HU, Szabolcs)",
        "ShortName": "hu-HU-Szabolcs",
        "Gender": "Male",
        "Locale": "hu-HU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (id-ID, Andika)",
        "ShortName": "id-ID-Andika",
        "Gender": "Male",
        "Locale": "id-ID"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (it-IT, Cosimo, Apollo)",
        "ShortName": "it-IT-Cosimo-Apollo",
        "Gender": "Male",
        "Locale": "it-IT"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (it-IT, LuciaRUS)",
        "ShortName": "it-IT-LuciaRUS",
        "Gender": "Female",
        "Locale": "it-IT"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ja-JP, Ayumi, Apollo)",
        "ShortName": "ja-JP-Ayumi-Apollo",
        "Gender": "Female",
        "Locale": "ja-JP"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ja-JP, HarukaRUS)",
        "ShortName": "ja-JP-HarukaRUS",
        "Gender": "Female",
        "Locale": "ja-JP"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ja-JP, Ichiro, Apollo)",
        "ShortName": "ja-JP-Ichiro-Apollo",
        "Gender": "Male",
        "Locale": "ja-JP"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ko-KR, HeamiRUS)",
        "ShortName": "ko-KR-HeamiRUS",
        "Gender": "Female",
        "Locale": "ko-KR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ms-MY, Rizwan)",
        "ShortName": "ms-MY-Rizwan",
        "Gender": "Male",
        "Locale": "ms-MY"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (nb-NO, HuldaRUS)",
        "ShortName": "nb-NO-HuldaRUS",
        "Gender": "Female",
        "Locale": "nb-NO"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (nl-NL, HannaRUS)",
        "ShortName": "nl-NL-HannaRUS",
        "Gender": "Female",
        "Locale": "nl-NL"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (pl-PL, PaulinaRUS)",
        "ShortName": "pl-PL-PaulinaRUS",
        "Gender": "Female",
        "Locale": "pl-PL"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (pt-BR, HeloisaRUS)",
        "ShortName": "pt-BR-HeloisaRUS",
        "Gender": "Female",
        "Locale": "pt-BR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (pt-BR, Daniel, Apollo)",
        "ShortName": "pt-BR-Daniel-Apollo",
        "Gender": "Male",
        "Locale": "pt-BR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (pt-PT, HeliaRUS)",
        "ShortName": "pt-PT-HeliaRUS",
        "Gender": "Female",
        "Locale": "pt-PT"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ro-RO, Andrei)",
        "ShortName": "ro-RO-Andrei",
        "Gender": "Male",
        "Locale": "ro-RO"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ru-RU, EkaterinaRUS)",
        "ShortName": "ru-RU-EkaterinaRUS",
        "Gender": "Female",
        "Locale": "ru-RU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ru-RU, Irina, Apollo)",
        "ShortName": "ru-RU-Irina-Apollo",
        "Gender": "Female",
        "Locale": "ru-RU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ru-RU, Pavel, Apollo)",
        "ShortName": "ru-RU-Pavel-Apollo",
        "Gender": "Male",
        "Locale": "ru-RU"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (sk-SK, Filip)",
        "ShortName": "sk-SK-Filip",
        "Gender": "Male",
        "Locale": "sk-SK"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (sl-SI, Lado)",
        "ShortName": "sl-SI-Lado",
        "Gender": "Male",
        "Locale": "sl-SI"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (sv-SE, HedvigRUS)",
        "ShortName": "sv-SE-HedvigRUS",
        "Gender": "Female",
        "Locale": "sv-SE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (ta-IN, Valluvar)",
        "ShortName": "ta-IN-Valluvar",
        "Gender": "Male",
        "Locale": "ta-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (te-IN, Chitra)",
        "ShortName": "te-IN-Chitra",
        "Gender": "Female",
        "Locale": "te-IN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (th-TH, Pattara)",
        "ShortName": "th-TH-Pattara",
        "Gender": "Male",
        "Locale": "th-TH"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (tr-TR, SedaRUS)",
        "ShortName": "tr-TR-SedaRUS",
        "Gender": "Female",
        "Locale": "tr-TR"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (vi-VN, An)",
        "ShortName": "vi-VN-An",
        "Gender": "Male",
        "Locale": "vi-VN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-CN, HuihuiRUS)",
        "ShortName": "zh-CN-HuihuiRUS",
        "Gender": "Female",
        "Locale": "zh-CN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-CN, Kangkang, Apollo)",
        "ShortName": "zh-CN-Kangkang-Apollo",
        "Gender": "Male",
        "Locale": "zh-CN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-CN, Yaoyao, Apollo)",
        "ShortName": "zh-CN-Yaoyao-Apollo",
        "Gender": "Female",
        "Locale": "zh-CN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-HK, Tracy, Apollo)",
        "ShortName": "zh-HK-Tracy-Apollo",
        "Gender": "Female",
        "Locale": "zh-HK"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-HK, TracyRUS)",
        "ShortName": "zh-HK-TracyRUS",
        "Gender": "Female",
        "Locale": "zh-HK"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-HK, Danny, Apollo)",
        "ShortName": "zh-HK-Danny-Apollo",
        "Gender": "Male",
        "Locale": "zh-HK"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-TW, HanHanRUS)",
        "ShortName": "zh-TW-HanHanRUS",
        "Gender": "Female",
        "Locale": "zh-TW"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-TW, Yating, Apollo)",
        "ShortName": "zh-TW-Yating-Apollo",
        "Gender": "Female",
        "Locale": "zh-TW"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-TW, Zhiwei, Apollo)",
        "ShortName": "zh-TW-Zhiwei-Apollo",
        "Gender": "Male",
        "Locale": "zh-TW"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, GuyNeural)",
        "ShortName": "en-US-GuyNeural",
        "Gender": "Male",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (en-US, JessaNeural)",
        "ShortName": "en-US-JessaNeural",
        "Gender": "Female",
        "Locale": "en-US"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (zh-CN, XiaoxiaoNeural)",
        "ShortName": "zh-CN-XiaoxiaoNeural",
        "Gender": "Female",
        "Locale": "zh-CN"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (it-IT, ElsaNeural)",
        "ShortName": "it-IT-ElsaNeural",
        "Gender": "Female",
        "Locale": "it-IT"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (de-DE, KatjaNeural)",
        "ShortName": "de-DE-KatjaNeural",
        "Gender": "Female",
        "Locale": "de-DE"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-ES, HelenaNeural)",
        "ShortName": "es-ES-HelenaNeural",
        "Gender": "Female",
        "Locale": "es-ES"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (es-MX, HildaNeural)",
        "ShortName": "es-MX-HildaNeural",
        "Gender": "Female",
        "Locale": "es-MX"
    },
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (pt-BR, FranciscaNeural)",
        "ShortName": "pt-BR-FranciscaNeural",
        "Gender": "Female",
        "Locale": "pt-BR"
    }
]


def find_voice(locale, gender, neural=True):
    """
    method to find voice
    """
    voice_no_neural = False
    i = 0
    # try to find the neural
    for voice in AZURE_VOICES:
        i = i + 1
        if voice['Locale'] == locale and voice['Gender'] == gender and voice['ShortName'][-6:] == 'Neural' and neural == True:
            return voice
        elif voice['Locale'] == locale and voice['Gender'] == gender and voice['ShortName'][-6:] != 'Neural':
            voice_no_neural = voice

    return voice_no_neural


# voice = find_voice(locale='en-US', gender='Male', neural=False)
# print('found voice:', voice)


# voice = find_voice(locale='en-US', gender='Female', neural=True)
# print('found voice:', voice)
