目录
PaddleSpeech/demos/text_to_speech at develop · PaddlePaddle/PaddleSpeech · GitHub
numpy报错:module 'numpy' has no attribute 'complex'.
espeak-ng
文本转声音PaddleSpeech:
PaddleSpeech/demos/text_to_speech at develop · PaddlePaddle/PaddleSpeech · GitHub
paddlespeech 只支持linux系统
AI语音模型PaddleSpeech踩坑(安装)指南_安装paddlegan和paddlespeech依赖-CSDN博客
python版安装:
pip3 install pytest-runner
pip3 install paddleaudio==1.0.1
pip3 install paddlespeech==1.0.1
麒麟系统报错:
libhdf5.so: cannot open shared object file: No such file or directory
sudo apt update
sudo apt install libhdf5-dev
export LD_LIBRARY_PATH=/usr/local/hdf5/lib:$LD_LIBRARY_PATH
pip3 uninstall h5py
pip3 install h5py
ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot accurately determine which fi les belong to it which would lead to only a partial uninstall.
blinker解决方法:
sudo apt-get remove blinker
sudo -H pip install --ignore-installed -U blinker
感谢博主:python3.6 pip install mitmproxy报错Cannot uninstall 'blinker'. It is a distutils installed project..._error: cannot uninstall 'blinker'. it is a distuti-CSDN博客
numpy报错:module 'numpy' has no attribute 'complex'.
解决方法:
pip3 install numpy==1.22
安装paddle:
pip3 install paddlepaddle==2.6.0
报错: No module named 'paddle.fluid'
网上解决方法:换用低版本的paddle。
No module named ‘paddle.fluid‘解决方案_no module named 'paddle.fluid-CSDN博客
麒麟系统没有安装成功
游戏音色库
蓝奏
https://wwrf.lanzout.com/b0137zdvg
密码:1fkn
----------有两个音色库太大,蓝奏放不下
度盘
https://pan.baidu.com/s/1u2qzShr7XfmL9UIzdjKkjg
密码4t9k
作者:千彻 https://www.bilibili.com/read/cv25505832/ 出处:bilibili
ttson效果很好 海豚配音
ttsmaker效果也不错
支持pc版下载:
每次需要验证码
网站参考:
pyttsx3
效果有点生硬
支持:文字转语音库,支持英文,中文,可以调节语速、语调等。
快速入门
## 安装 pip install pyttsx3
import pyttsx3
engine=pyttsx3.init() # 初始化
engine.say('hello word')# 设置读取内容
engine.say('轻轻的我走了,正如我轻轻的来')
# with open('./ku.txt','r',encoding='utf-8')as rf:
# engine.say(rf.read())
engine.runAndWait() # 执行朗诵
调节语速
-是变慢,+是变快
## 安装 pip install pyttsx3
import pyttsx3
msg = '''大江东去,浪淘尽,千古风流人物。故垒西边,人道是:三国周郎赤壁。乱石穿空,惊涛拍岸,卷起千层雪。江山如画,一时多少豪杰。
遥想公瑾当年,小乔初嫁了,雄姿英发。羽扇纶巾,谈笑间,樯橹灰飞烟灭。故国神游,多情应笑我,早生华发。人生初梦,一尊还酹江月'''
teacher = pyttsx3.init()
rate = teacher.getProperty('rate')
teacher.setProperty('rate', rate - 10)
teacher.say(msg)
teacher.runAndWait()
变换声音
注意只能变换英文,读取中文是不能变的;
import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
print(voice, voice.id)
engine.setProperty('voice', voice.id)
engine.say("开心")
engine.runAndWait()
engine.stop()
生成文件mp3文件
# Import the required module
import pyttsx3
# Create a string
string = "Lorem Ipsum is simply dummy text " \
+ "of the printing and typesetting industry."
# Initialize the Pyttsx3 engine
engine = pyttsx3.init()
# We can use file extension as mp3 and wav, both will work
engine.save_to_file(string, 'speech.mp3')
# Wait until above command is not finished.
engine.runAndWait()