chatterbox:基于开源技术的文本转语音模型项目

https://github.com/resemble-ai/chatterbox.git

Branch4Tags1
This repository is empty

Chatterbox 多语言图片

Chatterbox TTS

替代文本 替代文本 替代文本 Discord

resemble-logo-horizontal 精心打造

Chatterbox 是 Resemble AI 推出的一系列顶尖开源文本转语音模型。

最新发布:Chatterbox 多语言 V3

Chatterbox 多语言 V3 是 Chatterbox 系列中最新的通用多语言 TTS 模型。它保持了 0.5B 的模型规模,同时提升了说话人相似度,减少了幻觉现象,并能在多种语言中生成更自然、更具对话感的语音。

V3 延续了 V2 广泛的语言覆盖能力,同时稳定性更强,生成的语音更富表现力。对于需要一个能在多种语言间工作的语音克隆模型的用户,V3 是推荐的多语言模型。

除 V3 外,我们还发布了 单语言包:针对重点语言的专用微调模型,在需要更严格质量控制、更优特定语言表现和更专业语音生成的场景中发挥价值。

  • 广泛的多语言覆盖:作为 Chatterbox 的主要通用多语言模型,支持与 V2 相当的广泛语言范围。
  • 单语言包:专用单语言模型在语言和地区方言特定性能至关重要的场景下,提供更强的专业性和质量控制。
  • 更一致的说话人相似度:提升了跨语言的声音特征和口音保留能力,使跨语言语音克隆更稳定可靠。
  • 减少幻觉现象:V3 经过优化,减少了不必要的续接、重复和偏离提示的语音,尤其是在早期多语言模型表现不够稳定的情况下。

对于低延迟英语语音代理,Chatterbox-Turbo 是我们最高效的模型。它基于精简的 3.5 亿参数架构构建,Turbo 能以比我们之前模型更低的计算量和显存占用提供高质量语音。我们还对语音令牌到梅尔谱解码器(此前的瓶颈)进行了蒸馏,将生成步骤从 10 步减少到仅 1 步,同时保持高保真度音频输出。

副语言标签 现已原生支持 Turbo 模型,您可以使用 [cough][laugh][chuckle] 等标签增添独特的真实感。尽管 Turbo 主要为低延迟语音代理设计,但它在旁白和创意工作流中也表现出色。

对于资源最受限的部署场景,Chatterbox-Nano 采用与 Turbo 相同的架构,但参数规模更小,仅为 1.1 亿。它专为设备端和 CPU 推理设计——在 8 核 CPU 上可实现 3 倍于实时的运行速度——同时保留了单步解码器和原生副语言标签支持。当内存和延迟预算非常紧张时,Nano 是推荐模型。

如果您喜欢该模型,但需要扩展或调整以获得更高精度,请查看我们价格极具竞争力的 TTS 服务(链接)。它提供可靠的性能和低于 200 毫秒的超低延迟,非常适合代理、应用程序或交互式媒体中的生产使用。

Podonos Turbo 评估

⚡ 模型库

为您的应用选择合适的模型。

模型 大小 语言 主要特性 最适用于 🤗 示例
Chatterbox-Turbo 350M 英语 副语言标签([laugh])、低计算量和显存占用 零样本语音代理、生产环境 Demo Listen
Chatterbox-Nano 110M 英语 与Turbo相同架构、副语言标签、可在CPU上运行(8核CPU可达3倍实时速度) 设备端/CPU推理、低延迟和内存限制场景 Model
Chatterbox-Multilingual V3 (语言列表) 500M 23+ 提升说话人相似度、减少幻觉、更自然的多语言语音 全球应用、本地化、跨语言语音克隆 Demo Listen
单语言包 (模型) 每个500M 6种专用微调版本 特定语言和地区的质量控制 优先语言和对 dialect 敏感的应用 Models Demos
Chatterbox (使用技巧) 500M 英语 CFG 和夸张度调整 具有创意控制的通用零样本 TTS Demo Listen

安装

pip install chatterbox-tts

或者,您可以从源代码安装:

# conda create -yn chatterbox python=3.11
# conda activate chatterbox

git clone https://github.com/resemble-ai/chatterbox.git
cd chatterbox
pip install -e .

我们在 Debian 11 操作系统上基于 Python 3.11 开发并测试了 Chatterbox;pyproject.toml 中固定了依赖项的版本,以确保一致性。在此安装模式下,您可以修改代码或依赖项。

使用方法

Chatterbox-Turbo
import torchaudio as ta
import torch
from chatterbox.tts_turbo import ChatterboxTurboTTS

# Load the Turbo model
model = ChatterboxTurboTTS.from_pretrained(device="cuda")

# Generate with Paralinguistic Tags
text = "Hi there, Sarah here from MochaFone calling you back [chuckle], have you got one minute to chat about the billing issue?"

# Generate audio (requires a reference clip for voice cloning)
wav = model.generate(text, audio_prompt_path="your_10s_ref_clip.wav")

ta.save("test-turbo.wav", wav, model.sr)
Chatterbox-Nano

Nano 共享 Turbo 的架构,并通过传递 nano=True 参数,使用同一个 ChatterboxTurboTTS 类进行加载:

import torchaudio as ta
import torch
from chatterbox.tts_turbo import ChatterboxTurboTTS

# Load the Nano model (also runs on CPU: device="cpu")
model = ChatterboxTurboTTS.from_pretrained(device="cuda", nano=True)

# Generate with Paralinguistic Tags
text = "Hi there, Sarah here from MochaFone calling you back [chuckle], have you got one minute to chat about the billing issue?"

# Generate audio (requires a reference clip for voice cloning)
wav = model.generate(text, audio_prompt_path="your_10s_ref_clip.wav")

ta.save("test-nano.wav", wav, model.sr)
Chatterbox 与 Chatterbox-Multilingual

import torchaudio as ta
from chatterbox.tts import ChatterboxTTS
from chatterbox.mtl_tts import ChatterboxMultilingualTTS

device = "cuda"  # or "cpu" / "mps"

# English example
model = ChatterboxTTS.from_pretrained(device=device)

text = "Ezreal and Jinx teamed up with Ahri, Yasuo, and Teemo to take down the enemy's Nexus in an epic late-game pentakill."
wav = model.generate(text)
ta.save("test-english.wav", wav, model.sr)

# Multilingual V3 examples
multilingual_model = ChatterboxMultilingualTTS.from_pretrained(device=device, t3_model="v3")
# To use the legacy V2 multilingual checkpoint, omit t3_model or pass t3_model="v2".

french_text = "Bonjour, comment ça va? Ceci est le modèle de synthèse vocale multilingue Chatterbox, il prend en charge 23 langues."
wav_french = multilingual_model.generate(french_text, language_id="fr")
ta.save("test-french.wav", wav_french, multilingual_model.sr)

chinese_text = "你好,今天天气真不错,希望你有一个愉快的周末。"
wav_chinese = multilingual_model.generate(chinese_text, language_id="zh")
ta.save("test-chinese.wav", wav_chinese, multilingual_model.sr)

# If you want to synthesize with a different voice, specify the audio prompt
AUDIO_PROMPT_PATH = "YOUR_FILE.wav"
wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH)
ta.save("test-2.wav", wav, model.sr)

更多示例请参见 example_tts.pyexample_tts_turbo.pyexample_tts_nano.pyexample_vc.py

支持的语言

通用型 Chatterbox 多语言模型支持以下语言:

阿拉伯语(ar)• 丹麦语(da)• 德语(de)• 希腊语(el)• 英语(en)• 西班牙语(es)• 芬兰语(fi)• 法语(fr)• 希伯来语(he)• 印地语(hi)• 意大利语(it)• 日语(ja)• 韩语(ko)• 马来语(ms)• 荷兰语(nl)• 挪威语(no)• 波兰语(pl)• 葡萄牙语(pt)• 俄语(ru)• 瑞典语(sv)• 斯瓦希里语(sw)• 土耳其语(tr)• 中文(zh)

单语言包

单语言包为重点语言及地区变体提供专用微调版本。当您需要更强的语言特定表现、更严格的质量控制,或超越通用多语言模型的方言感知生成能力时,请使用这些包。

语言 模型卡片 演示空间
中文 ResembleAI/Chatterbox-Multilingual-zh-cmn Demo
拉丁美洲西班牙语 ResembleAI/Chatterbox-Multilingual-es-mx-latam Demo
巴西葡萄牙语 ResembleAI/Chatterbox-Multilingual-pt-br Demo
西班牙西班牙语 ResembleAI/Chatterbox-Multilingual-es-es Demo
葡萄牙葡萄牙语 ResembleAI/Chatterbox-Multilingual-pt-pt Demo
印地语 ResembleAI/Chatterbox-Multilingual-hi Demo

原始 Chatterbox 使用提示

  • 常规使用(TTS 和语音代理):

    • 确保参考音频片段与指定的语言标签相匹配。否则,语言转换输出可能会继承参考音频片段语言的口音。为减轻此问题,请将 cfg_weight 设置为 0
    • 默认设置(exaggeration=0.5cfg_weight=0.5)适用于大多数语言的大多数提示词。
    • 如果参考说话者语速较快,将 cfg_weight 降低到 0.3 左右可以改善节奏。
  • 富有表现力或戏剧性的语音:

    • 尝试较低的 cfg_weight 值(例如 ~0.3),并将 exaggeration 增加到 0.7 左右或更高。
    • 较高的 exaggeration 往往会加快语速;降低 cfg_weight 有助于以更慢、更从容的节奏进行补偿。

内置 PerTh 水印,助力负责任 AI

Chatterbox 生成的每个音频文件都包含 Resemble AI 的 Perth(感知阈值)水印器——这是一种不可感知的神经水印,能够在 MP3 压缩、音频编辑和常见操作中留存,同时保持近 100% 的检测准确率。

水印提取

您可以使用以下脚本查找水印。

import perth
import librosa

AUDIO_PATH = "YOUR_FILE.wav"

# Load the watermarked audio
watermarked_audio, sr = librosa.load(AUDIO_PATH, sr=None)

# Initialize watermarker (same as used for embedding)
watermarker = perth.PerthImplicitWatermarker()

# Extract watermark
watermark = watermarker.get_watermark(watermarked_audio, sample_rate=sr)
print(f"Extracted watermark: {watermark}")
# Output: 0.0 (no watermark) or 1.0 (watermarked)

官方 Discord

👋 欢迎加入我们的 Discord 社区,让我们一起打造更棒的项目!

评估

Chatterbox Turbo 是通过 Podonos 平台进行评估的,该平台用于可复现的主观语音评估。

我们使用 Podonos 的标准化评估套件,将 Chatterbox Turbo 与其他竞争性 TTS 系统进行了对比,重点关注整体偏好度、自然度和表现力。

评估报告:

这些评估是在完全相同的条件下进行的,并且可通过 Podonos 公开访问。

致谢

引用

如果您觉得此模型对您的研究有用,请考虑引用。

@misc{chatterboxtts2025,
  author       = {{Resemble AI}},
  title        = {{Chatterbox-TTS}},
  year         = {2025},
  howpublished = {\url{https://github.com/resemble-ai/chatterbox}},
  note         = {GitHub repository}
}

免责声明

请勿使用本模型从事不良行为。提示词来源于互联网上可免费获取的数据。

Introduction

https://github.com/resemble-ai/chatterbox.git

Customize your domain