X-Voice: Enabling Everyone to Speak 30 Languages via Zero-Shot Cross-Lingual Voice Cloning
X-Voice is a flow-matching-based multilingual zero-shot voice cloning system that enables one speaker to speak 30 languages.
News
Installation
Create a separate environment if needed
# Create a conda env with python_version>=3.11
conda create -n x-voice python=3.11
conda activate x-voice
# Install FFmpeg if you haven't yet
conda install ffmpeg
Install PyTorch with matched device
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/cu128
AMD GPU
# Install pytorch with your ROCm version (Linux only), e.g. pip install torch==2.5.1+rocm6.2 torchaudio==2.5.1+rocm6.2 --extra-index-url https://download.pytorch.org/whl/rocm6.2
Intel GPU
# Install pytorch with your XPU version, e.g. pip install torch torchaudio --index-url https://download.pytorch.org/whl/test/xpu
Apple Silicon
# Install the stable pytorch, e.g. pip install torch torchaudio
Install X-Voice
git clone https://github.com/sunnyxrxrx/X-Voice.git
cd X-Voice
pip install -e .
Check your ESpeak-ng installation:
espeak-ng --version
If not found, run src/x_voice/prepare_ipa.sh first.
Inference
- In order to achieve desired performance, take a moment to read detailed guidance.
1. Gradio App
x-voice_infer-gradio --host 0.0.0.0 --port 7860
2. CLI Inference
# X-Voice Stage1
python -m x_voice.infer.infer_cli_stage1 -c src/x_voice/infer/examples/basic/basic_stage1.toml
# X-Voice Stage2
python -m x_voice.infer.infer_cli_stage2 -c src/x_voice/infer/examples/basic/basic_stage2.toml
Training
TTS Model Training
Refer to training guidance for best practice.
Speaking Rate Predictor Training
Refer to speaking rate predictor guidance for the multilingual speaking rate predictor used in X-Voice.
Evaluation
Refer to evaluation guidance for benchmark and metric scripts.
Repo Structure
X-Voice/
├── ckpts/ # checkpoints
├── data/ # datasets and processed data
├── src/
│ ├── rate_pred/ # speaking rate predictor
│ ├── third_party/
│ │ └── BigVGAN/ # BigVGAN submodule
│ └── x_voice/ # main X-Voice package
└── pyproject.toml # package definition and dependencies
Development
Use pre-commit to ensure code quality:
pip install pre-commit
pre-commit install
pre-commit run --all-files
Acknowledgements
- F5-TTS brilliant work and the foundation of this codebase
- Cross-Lingual F5-TTS 2 for its supervised fine-tuning strategy with synthetic audio prompts
- Cross-Lingual F5-TTS for its speaking rate predictor
- NLLB for translation in the Gradio demo
- torchdiffeq as ODE solver, Vocos and BigVGAN as vocoder
- FunASR, faster-whisper, UniSpeech, SpeechMOS for evaluation tools
- MAVL for Japanese syllable counting
License
Our code is released under MIT License. The pre-trained models are licensed under the CC-BY-NC license due to the training data Emilia, which is an in-the-wild dataset. Sorry for any inconvenience this may cause.
Metadata
Release files for x-voice 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| x_voice-0.1.1.tar.gz | 29.9 MB | Without provenance | Details for x_voice-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| x_voice-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for x_voice-0.1.1-py3-none-any.whl |
Total release size: 60.1 MB
Release files / x_voice-0.1.1.tar.gz
| Download URL | x_voice-0.1.1.tar.gz |
|---|---|
| Size | 29.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c5525f17852125ba6b3171ab35224773af5f501a489abaccc8cd2babbada385
|
|
BLAKE2b-256 checksum How to use checksums |
8983fa0f1ef035df45e5fba9b82a4a3c2c0da5572b86ce41cd0df4734ed0889e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.0
|
Release files / x_voice-0.1.1-py3-none-any.whl
| Download URL | x_voice-0.1.1-py3-none-any.whl |
|---|---|
| Size | 30.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d8009469d39c6f63ec0476f21fbd3e48bb015ee76905beec841759695a1a386
|
|
BLAKE2b-256 checksum How to use checksums |
0b71789dde5a4e849c230f260a43639f9256433320c73079e917fe43719f2abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.0
|
Security for x-voice 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.