语音合成 文字转声音 配音

目录

游戏音色库

ttson效果很好 

ttsmaker效果也不错

网站参考:

pyttsx3

变换声音


游戏音色库

盘点下游戏音乐作曲家用的音色库 - 哔哩哔哩

蓝奏

https://wwrf.lanzout.com/b0137zdvg 

密码:1fkn

----------有两个音色库太大,蓝奏放不下

度盘

https://pan.baidu.com/s/1u2qzShr7XfmL9UIzdjKkjg

密码4t9k

作者:千彻 https://www.bilibili.com/read/cv25505832/ 出处:bilibili

ttson效果很好 

https://www.ttson.cn/

ttsmaker效果也不错

在线免费文字转语音 - TTSMaker官网 | 马克配音

网站参考:

分享 6 款文本转语音工具:带情感,非常逼真! - 知乎

高水平的人工智能配音软件有哪些? - 知乎

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()


 

你可能感兴趣的:(python基础,python,开发语言)