Error in user YAML: (<unknown>): found a tab character that violate indentation while scanning a plain scalar at line 3 column 3
---
- oeasy Python 0757
- 这是 oeasy 系统化 Python 教程,从基础一步步讲,扎实、完整、不跳步。愿意花时间学,就能真正学会。
- 本教程同步发布在:
- 个人网站: `https://oeasy.org`
- 蓝桥云课: `https://www.lanqiao.cn/courses/3584`
- GitHub: `https://github.com/overmind1980/oeasy-python-tutorial`
- Gitee: `https://gitee.com/overmind1980/oeasypython`
---import edge_tts
import asyncio
with open("poem.txt", encoding="utf-8") as f:
poem = f.read()
voice = "zh-CN-XiaoxiaoNeural" # 微软自然女声
async def tts():
communicate = edge_tts.Communicate(poem, voice)
await communicate.save("poem.wav")
if __name__ == "__main__":
asyncio.run(tts())
- 可以朗读出来
- 本文来自 oeasy Python 系统教程。
- 想完整、扎实学 Python,
- 搜索 oeasy 即可。