惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
T
Troy Hunt's Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
Latest news
Latest news
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
S
Schneier on Security
Cyberwarzone
Cyberwarzone
N
Netflix TechBlog - Medium
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
G
GRAHAM CLULEY
SecWiki News
SecWiki News
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
H
Heimdal Security Blog
GbyAI
GbyAI
C
Cybersecurity and Infrastructure Security Agency CISA
D
Docker
S
Secure Thoughts
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure
L
LINUX DO - 热门话题
Help Net Security
Help Net Security
博客园 - 司徒正美
C
Cisco Blogs
月光博客
月光博客
O
OpenAI News
P
Proofpoint News Feed
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
L
Lohrmann on Cybersecurity
宝玉的分享
宝玉的分享
D
DataBreaches.Net
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - 慕尘

在浏览器跑 Qwen2.5 使用 WSL 在 Windows 上安装 Linux LangExtract pgvector 向量数据库 Faiss Goose trafilatura unstructured python里使用Playwright python的jieba MinGW nomic-embed-text 解析非结构化数据 LangChain 的 DocumentLoader 能够使用require但不能使用import ChromaDB nvm-windows 使用js实现文字转语音 Ollama笔记
pyttsx3
慕尘 · 2025-02-28 · via 博客园 - 慕尘

pyttsx3是一个功能强大的 Python 文本转语音(TTS)库,支持离线语音合成

pip install pyttsx3

文本转语音

import pyttsx3

# 初始化语音引擎
engine = pyttsx3.init()

# 设置需要朗读的文本
engine.say("你好,世界!")

# 运行语音引擎
engine.runAndWait()

文本存mp3

import pyttsx3

# 初始化语音引擎
engine = pyttsx3.init()
engine.setProperty('rate', 200)
# 定义MP3文件名称。
filename = "output.mp3"
text = "你好,世界!"
# 保存MP3音频文件。
engine.save_to_file(text, filename)
engine.runAndWait()