Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

OmniVoice

> 编程语言
Open source

High-Quality Voice Cloning TTS for 600+ Languages

8.7K stars0 likes0 views
WebsiteGitHub

About

High-Quality Voice Cloning TTS for 600+ Languages

OmniVoice

       

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

Key Features

  • 600+ Languages Supported: The broadest language coverage among zero-shot TTS models (full list).
  • Voice Cloning: State-of-the-art voice cloning quality.
  • Voice Design: Control voices via assigned speaker attributes (gender, age, pitch, dialect/accent, whisper, etc.).
  • Fine-grained Control: Non-verbal symbols (e.g., [laughter]) and pronunciation correction via pinyin or phonemes.
  • Fast Inference: RTF as low as 0.025 (40x faster than real-time).
  • Diffusion Language Model-style Architecture: A clean, streamlined, and scalable design that delivers both quality and speed.

Installation

Choose one of the following methods: pip or uv.

pip

We recommend using a fresh virtual environment (e.g., conda, venv, etc.) to avoid conflicts.

Step 1: Install PyTorch

NVIDIA GPU
bash
# 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

See PyTorch official site for other versions installation.

Apple Silicon
bash
pip install torch==2.8.0 torchaudio==2.8.0
Intel Arc GPU (XPU)

Intel Arc GPUs (Alchemist and Battlemage architectures) are supported via PyTorch's XPU backend.

  1. Install the Intel GPU drivers for your OS.

  2. Install PyTorch with XPU support from Intel's wheel index:

bash
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.

  1. Verify the backend is working:
bash
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.
  • Training with packed sequences (flex_attention) has partial XPU support; single-GPU SDPA training should work.
  • Tested on Arc A310 (Alchemist, 4 GB) and Arc Pro B50 (Battlemage, 16 GB).

Step 2: Install OmniVoice (choose one)

bash
# 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 .

uv

Clone the repository and sync dependencies:

bash
git clone https://github.com/k2-fsa/OmniVoice.git
cd OmniVoice
uv sync

Tip: Can use mirror with uv sync --default-index "https://mirrors.aliyun.com/pypi/simple"


Quick Start

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

  • Or run it in Google Colab:

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.


Python API

OmniVoice supports three generation modes. All features in this section are also available via command-line tools.

Voice Cloning

Clone a voice from a short reference audio. Provide ref_audio and ref_text:

…

Reusing a cloned voice across sessions

Encode the reference audio once, save the resulting prompt, and skip the audio loading / auto-transcription steps in later sessions:

python
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=True to generate() to do this automatically (opt-in; install the extra with pip install "omnivoice[tn]", which pulls in WeTextProcessing):

    python
    # "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 num2words for integers. Inline control syntax ([laughter], [B EY1 S], pinyin tone markers) is preserved. On macOS (Apple Silicon), pynini has no wheel — install it via conda install -c conda-forge pynini first.

For more tips, see docs/tips.md.

Voice Design

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.

python
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.

Auto Voice

Let the model choose a voice automatically:

python
audio = model.generate(text="This is a sentence without any voice prompt.")

Generation Parameters

All above three modes share the same model.generate() API. You can further control the generation behavior via keyword arguments:

python
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.

Non-Verbal & Pronunciation Control

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.

python
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.

python
audio = model.generate(text="这批货物打ZHE2出售后他严重SHE2本了,再也经不起ZHE1腾了。")

Pronunciation control (English): Use CMU pronunciation dictionary (uppercase, in brackets) to override default English pronunciations.

python
audio = model.generate(text="He plays the [B EY1 S] guitar while catching a [B AE1 S] fish.")

Command-Line Tools

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

Demo

bash
omnivoice-demo --ip 0.0.0.0 --port 8001

Provides a web UI for voice cloning and voice design. See omnivoice-demo --help for all options.

Single Inference

…

Batch Inference

omnivoice-infer-batch can distribute batch inference across multiple GPUs, designed for large-scale TTS tasks.

bash
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:

json
{"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.

FlashInfer Acceleration

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

bash
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:

bash
omnivoice-infer-batch \
    --model k2-fsa/OmniVoice \
    --test_list test.jsonl \
    --res_dir results/ \
    --batch_size 8 \
    --enable_flashinfer true

or with the Python API:

python
from omnivoice.models.omnivoice_flashinfer import apply_flash

Issues· 67 open

View all issuesOpen on GitHub
  • #236

    Feature Request: Support Importing SRT Subtitle Files

    enhancementStaleUpdated Sep 27, 2026
  • #274

    Make torchaudio optional — only used for resampling at inference time

    enhancementUpdated Sep 26, 2026
  • #245

    Generated audio frequently cuts off the end of the sentence

    bugStaleUpdated Sep 25, 2026
  • #271

    _ problem

    bugUpdated Sep 22, 2026
  • #244

    Clarifications on multilingual data construction (resampling, prompt-denoising, subset of data augmentation, restoration/filtering, text tokenizer) + request for implementation code

    questionUpdated Sep 21, 2026
  • #237

    Reducing Inconsistent Word Pronunciation Across Generations

    help wantedStaleUpdated Sep 18, 2026
  • #246

    OmniVoice Voice Cloning / Pronunciation Accuracy Issue

    bugUpdated Sep 18, 2026
  • #241

    Support for Context Across Multiple Sentence Generation

    questionStaleUpdated Sep 14, 2026
  • #268

    [Feature Request] Suggestions for Future Updates: Improved Dialect Accuracy, Emotional Expression, and VRAM Utilization

    enhancementUpdated Sep 13, 2026
  • #267

    `torch` resolves to 2.14.0 (PyPI) or 2.11.0+cu128 (download.pytorch.org/whl/cu128) depending on install path (pip install .)

    bugUpdated Sep 12, 2026

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言