edge tts 文字转语音
import edge_tts import asyncio from playsound import playsound async def run_tts(text: str, output: str, voice: str ='zh-CN-XiaoxiaoNeural') -> None: communicate = edge_tts.Communicate(text, voice) await communicate.save(output) if __name__ == '__main__': asyncio.run(run_tts('你好, 我是您的朋友,我叫晓晓', 'edge-tts-output.mp3')) playsound('edge-tts-output.mp3')