OmniVoice 是一款大规模多语言零样本文本转语音(TTS)模型,支持超过 600 种语言。它基于创新的扩散语言模型架构构建,能生成高质量语音,同时拥有出色的推理速度,并支持声音克隆和声音设计功能。
[laughter])以及通过拼音或音素进行发音纠正。首先,请安装 omnivoice 库:
建议使用全新的虚拟环境(例如
conda、venv等)以避免冲突。
步骤 1:安装 PyTorch
# Install pytorch with your CUDA version, e.g.
pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128其他版本的安装说明请参见 PyTorch 官方网站。
pip install torch==2.8.0 torchaudio==2.8.0步骤 2:安装 OmniVoice
pip install omnivoice您可以按以下方式使用 OmniVoice 进行零样本语音克隆:
from omnivoice import OmniVoice
import soundfile as sf
import torch
# Load the model
model = OmniVoice.from_pretrained(
"k2-fsa/OmniVoice",
device_map="cuda:0",
dtype=torch.float16
)
# Generate audio
audio = model.generate(
text="Hello, this is a test of zero-shot voice cloning.",
ref_audio="ref.wav",
ref_text="Transcription of the reference audio.",
) # audio is a list of `np.ndarray` with shape (T,) at 24 kHz.
sf.write("out.wav", audio[0], 24000)如需了解更多生成模式(例如语音设计)、功能(例如非语言符号、发音纠正)以及全面的使用说明,请参阅我们的 GitHub 仓库。
您可以直接在 GitHub Issues 上进行讨论。
您也可以扫描二维码加入我们的微信群或关注我们的微信公众号。
| 微信群 | 微信公众号 |
|---|---|
![]() | ![]() |
@article{zhu2026omnivoice,
title={OmniVoice: Towards Omnilingual Zero-Shot Text-to-Speech with Diffusion Language Models},
author={Zhu, Han and Ye, Lingxuan and Kang, Wei and Yao, Zengwei and Guo, Liyong and Kuang, Fangjun and Han, Zhifeng and Zhuang, Weiji and Lin, Long and Povey, Daniel},
journal={arXiv preprint arXiv:2604.00688},
year={2026}
}严禁用户将本模型用于未经授权的语音克隆、语音模仿、欺诈、诈骗或任何其他非法或不道德活动。所有用户应确保完全遵守适用的当地法律法规和道德标准。开发者对本模型的任何滥用不承担责任,并倡导负责任的AI开发和使用,鼓励社区在AI研究和应用中坚守安全和道德原则。