tortoise-tts是一个开源的文本转语音(TTS)系统,由James Betker开发。它具有以下主要特点:
tortoise-tts的名字来源于莫哈韦沙漠的动植物,寓意其生成语音的速度较慢但质量很高。
可以直接通过pip从GitHub仓库安装最新开发版:
pip install git+https://github.com/neonbjb/tortoise-tts
conda create --name tortoise python=3.9 numba inflect
conda activate tortoise
详细步骤请参考官方安装指南。
from TTS.api import TTS tts = TTS("tts_models/en/multi-dataset/tortoise-v2") # 生成语音 tts.tts_to_file(text="Hello, this is a test.", file_path="output.wav") # 使用预设 tts.tts_to_file(text="Another test.", file_path="output2.wav", preset="ultra_fast") # 语音克隆 tts.tts_to_file(text="Voice cloning test.", file_path="output3.wav", speaker="lj", voice_dir="path/to/voice/samples/")
tts --model_name tts_models/en/multi-dataset/tortoise-v2 \
--text "This is an example." \
--out_path output.wav
可以在Hugging Face Spaces上体验tortoise-tts的在线演示。
tortoise-tts作为一个高质量的开源TTS系统,为研究人员和开发者提供了强大的语音合成工具。欢迎大家尝试使用并为项目贡献代码!