edge-tts-read
Skill1 starsChanged 48 days agoMITView on GitHub
文字转语音:微软 Edge 在线音色免费合成,中文多音色,可出字幕文件。触发词:文字转语音、朗读、配音、生成语音、TTS、edge-tts。
- Installs packages
Files
文字转语音(Edge TTS)
底层是 edge-tts:调用微软 Edge 浏览器"大声朗读"的在线语音合成服务。免费、无需密钥,音色是微软神经网络音色(Azure TTS 同源),中文音色齐全——零成本的文字转语音方案。
定位提醒:这是社区对微软在线服务的非官方调用,服务可用性不承诺 SLA;重要生产链路请备选离线方案(如 sherpa-onnx 的离线 TTS)。
与姊妹技能的分工
| 需求 | 用哪个 |
| 在线免费、音色自然 | 本技能(edge-tts) |
| 完全离线合成 | 本地语音套件(sherpa-onnx)TTS 部分 |
| 语音转文字 | 中文语音转写(FunASR)/ 语音转写(Whisper) |
一、安装
pip install edge-tts纯 Python 轻包(依赖 aiohttp),秒装。需要联网(调用微软服务)。
二、命令行
edge-tts --voice zh-CN-XiaoxiaoNeural --text "下午三点开会,请准时参加。" --write-media 通知.mp3
edge-tts --voice zh-CN-XiaoxiaoNeural --file 文章.txt --write-media 文章.mp3 --write-subtitles 文章.vtt
edge-tts --list-voices # 全部音色
edge-tts --voice zh-CN-XiaoxiaoNeural --rate=+10% --pitch=+5Hz --text "语速调快" --write-media out.mp3三、常用中文音色
| 音色名 | 特点 |
zh-CN-XiaoxiaoNeural | 晓晓·女声(最常用,多情感风格) |
zh-CN-YunxiNeural | 云希·男声(活泼) |
zh-CN-YunyangNeural | 云扬·男声(新闻播报) |
zh-CN-YunxiaNeural | 云夏·女声(少年感) |
zh-CN-liaoning-XiaobeiNeural | 东北话·女声 |
zh-HK-HiuMaanNeural | 粤语·女声 |
zh-TW-HsiaoChenNeural | 台湾腔·女声 |
完整列表以 --list-voices 为准(还有陕西、河南等方言音色)。
四、Python API
import asyncio, edge_tts
async def main():
tts = edge_tts.Communicate("今天的数据日报已生成", voice="zh-CN-XiaoxiaoNeural")
await tts.save("日报播报.mp3")
asyncio.run(main())五、批量合成(推荐用脚本)
python scripts/tts_batch.py 文章目录 -o out # 每个 .txt → .mp3
python scripts/tts_batch.py 通知.txt -o out --voice zh-CN-YunyangNeural --subtitle
python scripts/tts_batch.py 目录 -o out --rate "+10%" --dry-run脚本逐个文本文件合成,失败不中断;--subtitle 同时产出 .vtt 字幕(按文本行分段)。
六、常见坑
- 报错 NoAudioReceived → 微软服务抖动或网络受限:重试;换网络;不要高频连续调用
- 长文本超时 → 按 1500–3000 字分段合成后拼接(脚本已内置分段逻辑)
- 多音字读错 → 换音色或改写文本(TTS 通病)
- 语速调节无效 →
--rate=+10%的+必须带上 - 商用提醒 → 音色属微软服务,正式产品商用前请自行确认使用边界;本项目不打包、不转售该服务
七、边界
- 非官方接口,微软随时可能调整——生产环境务必有离线备选
- 不做情感极致控制(SSML 细粒度调节是 Azure 官方 API 的能力)
- 输出 mp3(webm 音频);要 wav 先转格式
In this repository60 other files it gives its agents.
- accessibility-auditSkill
- agent-browser-coreSkill
- ai-explainer-videoSkill
- ai-short-video-makerSkill
- ai-video-shortSkill
- AI 工具箱Skill
- antislopSkill
- browser-useSkill
- cangjie-skillSkill
- delivery-no-pseudoblockSkill
- design-reviewSkill
- design-routerSkill
- frontend-designSkill
- frontend-devSkill
- fuheshun-auto-clipSkill
- fullstack-devSkill
- githubSkill
- git-shipSkill
- grillingSkill
- hfut-inspectorSkill
- humanizerSkill
- image-to-editable-pptxSkill
- kdocsSkill
- local-video-pipelineSkill
- markitdown-skillSkill
- pdfSkill
- pptxSkill
- qf-english-polishSkill
- qq-emailSkill
- responsive-designSkill
- self-improving-agentSkill
- sherpa-onnx-ttsSkill
- short-video-script-to-finished-videoSkill
- skill-creatorSkill
- skill-integratorSkill
- tastemakerSkill
- techdebtSkill
- Typography FoundationsSkill
- ui-designSkill
- video-scriptSkill
- web-accessSkill
- web-design-guidelinesSkill
- web-design-layoutSkill
- wechat-article-proSkill
- wechat-article-searchSkill
- weekly-reviewSkill
- word-toolkitSkill
- WorkBuddy 工作原则Skill
- xlsxSkill
- yuketang-harvesterSkill
- 学术研究工具箱Skill
- 安全审查工具箱Skill
- 工程方法论工具箱Skill
- 开发工具箱Skill
- 微信小程序开发套件Skill
- 技能包跨机器打包Skill
- 文档工具箱Skill
- 知识工具箱Skill
- 联网工具箱Skill
- 评审委员会Skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

