High-Quality Voice Cloning TTS for 600+ Languages
OmniVoice is a state-of-the-art massively multilingual zero-shot text-to-speech (TTS) model supporting over 600 languages. Built on a novel diffusion language model-style architecture, it generates high-quality speech with superior inference speed, supporting voice cloning and voice design.
Contents: Key Features | Installation | Quick Start | Python API | Command-Line Tools | Training & Evaluation | Discussion | Citation
[laughter]) and pronunciation correction via pinyin or phonemes.Choose one of the following methods: pip or uv.
We recommend using a fresh virtual environment (e.g.,
conda,venv, etc.) to avoid conflicts.
Step 1: Install PyTorch
NVIDIA GPU# 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/cu128Apple SiliconSee PyTorch official site for other versions installation.
pip install torch==2.8.0 torchaudio==2.8.0Intel Arc GPUs (Alchemist and Battlemage architectures) are supported via PyTorch's XPU backend.
Install the Intel GPU drivers for your OS.
Install PyTorch with XPU support from Intel's wheel index:
pip install torch torchaudio --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/See Intel's PyTorch XPU guide for version-specific instructions.
python -c "import torch; print(torch.xpu.is_available(), torch.xpu.device_count())"Notes:
flash_attn is not available on XPU; the model automatically falls back to SDPA.flex_attention) has partial XPU support; single-GPU SDPA training should work.Step 2: Install OmniVoice (choose one)
# From PyPI (stable release)
pip install omnivoice
# From the latest source on GitHub (no need to clone)
pip install git+https://github.com/k2-fsa/OmniVoice.git
# For development (clone first, editable install)
git clone https://github.com/k2-fsa/OmniVoice.git
cd OmniVoice
pip install -e .Clone the repository and sync dependencies:
git clone https://github.com/k2-fsa/OmniVoice.git
cd OmniVoice
uv syncTip: Can use mirror with
uv sync --default-index "https://mirrors.aliyun.com/pypi/simple"
Try OmniVoice without coding:
Launch the local web UI: omnivoice-demo --ip 0.0.0.0 --port 8001
Or try it directly on HuggingFace Space
If you have trouble connecting to HuggingFace when downloading the pre-trained models, set
export HF_ENDPOINT="https://hf-mirror.com"before running.
For full usage, see the Python API and Command-Line Tools sections below.
OmniVoice supports three generation modes. All features in this section are also available via command-line tools.
Clone a voice from a short reference audio. Provide ref_audio and ref_text:
…Encode the reference audio once, save the resulting prompt, and skip the audio loading / auto-transcription steps in later sessions:
prompt = model.create_voice_clone_prompt(
ref_audio="ref.wav", ref_text="Transcription of the reference audio."
)
prompt.save("my_voice.pt")
# Later, in a new session:
from omnivoice import VoiceClonePrompt
prompt = VoiceClonePrompt.load("my_voice.pt")
audio = model.generate(text="Hello again!", voice_clone_prompt=prompt)Tips
Use a 3–10 seconds reference audio clip. Longer audio slows down inference and may degrade cloning quality.
For standard pronunciation, use a reference audio in the same language as the target speech. In cross-lingual voice cloning (i.e., the reference audio and target speech are in different languages), the generated speech will carry an accent from the reference audio's language.
For better results with Arabic numerals, normalize them to words first (e.g., "123" → "one hundred twenty-three"). You can pass
normalize_text=Truetogenerate()to do this automatically (opt-in; install the extra withpip install "omnivoice[tn]", which pulls in WeTextProcessing):# "I have 2345 apples." is read correctly instead of digit-by-digit. audio = model.generate(text="I have 2345 apples.", normalize_text=True)Chinese and English use WeTextProcessing; other languages fall back to
num2wordsfor integers. Inline control syntax ([laughter],[B EY1 S], pinyin tone markers) is preserved. On macOS (Apple Silicon),pyninihas no wheel — install it viaconda install -c conda-forge pyninifirst.For more tips, see docs/tips.md.
Describe the desired voice with speaker attributes — no reference audio needed. Supported attributes: gender (male/female), age (child to elderly), pitch (very low to very high), style (whisper), English accent (American, British, etc.), and Chinese dialect (四川话, 陕西话, etc.). Attributes are comma-separated and freely combinable across categories.
audio = model.generate(
text="Hello, this is a test of zero-shot voice design.",
instruct="female, low pitch, british accent",
)Note: The model is primarily trained on the voice cloning task, so voice cloning is the most stable mode. Voice design is trained on Chinese and English data only. It can generalize to other languages, but may produce unstable results for some low-resource languages or edge cases.
See docs/voice-design.md for the full attribute reference, Chinese equivalents, and usage tips.
Let the model choose a voice automatically:
audio = model.generate(text="This is a sentence without any voice prompt.")All above three modes share the same model.generate() API. You can further control the generation behavior via keyword arguments:
audio = model.generate(
text="...",
num_step=32, # diffusion steps (or 16 for faster inference)
speed=1.0, # speed factor (>1.0 faster, <1.0 slower)
duration=10.0, # fixed output duration in seconds (overrides speed)
# ... more options
)See more detailed control in docs/generation-parameters.md.
OmniVoice supports inline non-verbal symbols and pronunciation correction within the input text.
Non-verbal symbols: Insert tags like [laughter] directly in the text to add expressive non-verbal sounds.
audio = model.generate(text="[laughter] You really got me. I didn't see that coming at all.")Supported tags: [laughter], [sigh], [confirmation-en], [question-en], [question-ah], [question-oh], [question-ei], [question-yi], [surprise-ah], [surprise-oh], [surprise-wa], [surprise-yo], [dissatisfaction-hnn].
Pronunciation control (Chinese): Use pinyin with tone numbers to correct specific character pronunciations.
audio = model.generate(text="这批货物打ZHE2出售后他严重SHE2本了,再也经不起ZHE1腾了。")Pronunciation control (English): Use CMU pronunciation dictionary (uppercase, in brackets) to override default English pronunciations.
audio = model.generate(text="He plays the [B EY1 S] guitar while catching a [B AE1 S] fish.")Three CLI entry points are provided. The CLI tools support all features available in the Python API (voice cloning, voice design, auto voice, generation parameters, etc.) — all controlled via command-line arguments.
| Command | Description | Source |
|---|---|---|
omnivoice-demo |
Interactive Gradio web demo | omnivoice/cli/demo.py |
omnivoice-infer |
Single-item inference | omnivoice/cli/infer.py |
omnivoice-infer-batch |
Batch inference across multiple GPUs | omnivoice/cli/infer_batch.py |
omnivoice-demo --ip 0.0.0.0 --port 8001Provides a web UI for voice cloning and voice design. See omnivoice-demo --help for all options.
…omnivoice-infer-batch can distribute batch inference across multiple GPUs, designed for large-scale TTS tasks.
omnivoice-infer-batch \
--model k2-fsa/OmniVoice \
--test_list test.jsonl \
--res_dir results/The test list is a JSONL file where each line is a JSON object:
{"id": "sample_001", "text": "Hello world", "ref_audio": "/path/to/ref.wav", "ref_text": "Reference transcript", "instruct": "female, british accent", "language_id": "en", "duration": 10.0, "speed": 1.0}Only id and text are mandatory fields. ref_audio and ref_text are used in voice cloning mode. instruct is used in voice design mode. If no reference audio or instruct are provided, the model will generate text in a random voice.
language_id, duration, and speed are optional. duration (in seconds) fixes the output length; speed controls the speaking rate. If duration and speed are both provided, speed will be ignored.
Inference can be accelerated ~2-2.9x losslessly with FlashInfer kernels (sequence packing for the CFG cond/uncond pair, fused RMSNorm/RoPE/GEMM kernels, and optional CUDA graphs).
Installation (NVIDIA GPUs; pick the index matching your CUDA version, e.g. cu128 for PyTorch built with CUDA 12.8):
pip install flashinfer-python==0.6.15.post1 "flashinfer-jit-cache==0.6.15.post1+cu128" \
--extra-index-url https://flashinfer.ai/whl/cu128/Usage with the batch inference CLI:
omnivoice-infer-batch \
--model k2-fsa/OmniVoice \
--test_list test.jsonl \
--res_dir results/ \
--batch_size 8 \
--enable_flashinfer trueor with the Python API:
from omnivoice.models.omnivoice_flashinfer import apply_flashFeature Request: Support Importing SRT Subtitle Files
Make torchaudio optional — only used for resampling at inference time
Generated audio frequently cuts off the end of the sentence
_ problem
Clarifications on multilingual data construction (resampling, prompt-denoising, subset of data augmentation, restoration/filtering, text tokenizer) + request for implementation code
Reducing Inconsistent Word Pronunciation Across Generations
OmniVoice Voice Cloning / Pronunciation Accuracy Issue
Support for Context Across Multiple Sentence Generation
[Feature Request] Suggestions for Future Updates: Improved Dialect Accuracy, Emotional Expression, and VRAM Utilization
`torch` resolves to 2.14.0 (PyPI) or 2.11.0+cu128 (download.pytorch.org/whl/cu128) depending on install path (pip install .)