import edge_tts


def voice_list():
    res = ["zh-CN-XiaoxiaoNeural (女性)", "zh-CN-XiaoyiNeural (女性)", "zh-CN-YunjianNeural (男性)",
           "zh-CN-YunxiNeural (男性)",
           "zh-CN-YunxiaNeural (男性)", "zh-CN-YunyangNeural (男性)", "zh-CN-XiaobeiNeural (女性)",
           "zh-CN-XiaoniNeural (女性)",
           "zh-HK-HiuGaaiNeural (女性)", "zh-HK-HiuMaanNeural (女性)", "zh-HK-WanLungNeural (男性)",
           "zh-TW-HsiaoChenNeural (女性)",
           "zh-TW-HsiaoYuNeural (女性)", "zh-TW-YunJheNeural (男性)"]
    return res


async def text_to_audio(text, voice_user, outfile):
    communicate = edge_tts.Communicate(text, voice_user)
    await communicate.save(outfile)
