{"id":13617840,"url":"https://github.com/skygongque/tts","last_synced_at":"2025-05-15T03:02:58.680Z","repository":{"id":37631779,"uuid":"469344160","full_name":"skygongque/tts","owner":"skygongque","description":"微软 tts 文本转语音 音频下载","archived":false,"fork":false,"pushed_at":"2025-03-29T00:17:17.000Z","size":7610,"stargazers_count":898,"open_issues_count":5,"forks_count":202,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-11T14:17:17.563Z","etag":null,"topics":["javascript","python","tampermonkey"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skygongque.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-13T10:57:53.000Z","updated_at":"2025-04-11T12:58:47.000Z","dependencies_parsed_at":"2024-04-09T13:02:57.029Z","dependency_job_id":"cb5482da-5270-436d-bfb3-36f5fa060571","html_url":"https://github.com/skygongque/tts","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"b5a35df90685ef4b82b65d304fe8c10a6a70608f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skygongque%2Ftts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skygongque%2Ftts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skygongque%2Ftts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skygongque%2Ftts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skygongque","download_url":"https://codeload.github.com/skygongque/tts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264737,"owners_count":22041789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","python","tampermonkey"],"created_at":"2024-08-01T20:01:49.071Z","updated_at":"2025-05-15T03:02:58.606Z","avatar_url":"https://github.com/skygongque.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# 微软tts音频下载解决方案\n\u003e 微软tts 使用 119 种语言和变体，超过 270 种神经语音来吸引全球观众。使用极具表现力和类似人类的声音将你的方案(如文本阅读器和支持语音的助手)变为现实。神经文本到语音转换功能支持若干种话语风格，包括聊天、新闻播报和客户服务，以及各种情感(如快乐和同情)。\n\n## 官方的demo地址（目前仅有介绍不支持语音合成）\n```\nhttps://azure.microsoft.com/zh-cn/products/cognitive-services/text-to-speech/#overview\n```\n\u003e 目前azure的网页版demo已经关闭，原先的tampermonkey方法失效  \n\n# 项目目的和声明\n- 本项目用python实现了microsoft语音合成试用接口(tts2.py)、edge大声朗读接口的调用(tts.py)\n- 本项目仅用于学习交流禁止用于商业用途\n\n\n## 使用方法\n\n使用方法视频版本\nhttps://www.bilibili.com/video/BV13S4y1D7u7   \n\n\n安装依赖\n\n```\npip install -r requirements.txt\n```\n\n运行\n\n```bash\npython tts.py --input SSML.xml \n## 或者 \npython tts2.py --input SSML.xml\n```\n\n\u003e 在python_cli_demo目录下 使用python 运行tts.py，通过参数input传入`SSML.xml`文件的路径\n\n或者可以通过传入`output` 传入希望保存的文件名\n\n```bash\npython tts.py --input SSML.xml --output 保存文件名 \n# 或者\npython tts2.py --input SSML.xml --output 保存文件名 \n```\n\n`SSML.xml`文件的示例如下\n\n```\n\u003cspeak xmlns=\"http://www.w3.org/2001/10/synthesis\" xmlns:mstts=\"http://www.w3.org/2001/mstts\" xmlns:emo=\"http://www.w3.org/2009/10/emotionml\" version=\"1.0\" xml:lang=\"en-US\"\u003e\n    \u003cvoice name=\"zh-CN-XiaoxiaoNeural\"\u003e\n        \u003cprosody rate=\"0%\" pitch=\"0%\"\u003e\n        这个是 SSML 语音合成标记语言\n        \u003c/prosody\u003e\n    \u003c/voice\u003e\n\u003c/speak\u003e\n```\n\u003e 为了通俗易懂代码没有进行任何不必要的封装，tts.py 和tts2.py在均可独立运行。\n\u003e\n\n## 接口说明\n\n**tts.py** 使用edge大声朗读接口（下称edge接口）   \n\n接口地址 wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1\n\n**tts2.py** 使用microsoft语音合成试用接口（下称microsoft接口）\n\n接口地址 https://southeastasia.api.speech.microsoft.com/accfreetrial/texttospeech/acc/v3.0-beta1/vcg/speak\n\n|               | 稳定性 | 是否付费 | 是否支持说话风格 | 代码示例   |\n| ------------- | ------ | -------- | ---------------- | ---------- |\n| edge接口      | 中     | 免费     | 否               | tts.py     |\n| microsoft接口 | 低     | 免费     | 是               | tts2.py    |\n| azure接口     | 高     | 付费     | 是               | 见官方文档 |\n\n## 其他项目\n如果需要成品软件建议直接下载LokerL大佬编写的成品软件，有UI界面适合没有编程基础的一般用户，https://github.com/LokerL/tts-vue/releases \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskygongque%2Ftts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskygongque%2Ftts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskygongque%2Ftts/lists"}