Registry / ai-ml / omnivoice

omnivoice

JSON →
library0.1.5pypypi✓ verified 83d ago

OmniVoice is a zero-shot text-to-speech library using diffusion language models. It supports multilingual TTS with voice cloning from short audio samples. Current version 0.1.5, actively maintained. Requires Python >= 3.10.

pip install omnivoice
INSTALL
IMPORT
SIG · OMNIVOICE
O
omnivoice
ai-mlpythonv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OmniVoice
from omnivoice import OmniVoice
from omnivoice.model import OmniVoice
Direct import path changed in early versions.
infer
from omnivoice import infer
from omnivoice.inference import infer
Inference function available at top-level.

Basic TTS inference with voice cloning.

from omnivoice import OmniVoice, infer # Load model model = OmniVoice.from_pretrained("k2-fsa/OmniVoice") # Synthesize speech audio = infer(model, text="Hello world", reference_audio="ref.wav", reference_text="The quick brown fox") # Save to file import torchaudio torchaudio.save("output.wav", audio.unsqueeze(0), 24000)
Debug
Known issues
breakingModel loading without internet will fail if cache is missing. Use local pretrained path explicitly.
fix
Set OMNIVOICE_CACHE_DIR or download model files manually.
affects: <=0.1.5
gotchaReference audio must be monophonic and at 24kHz sample rate. Mismatch causes quality degradation.
fix
Resample audio to 24000 Hz and convert to mono before passing.
affects: all
gotchaInference on MPS (Apple Silicon) may fail due to unsupported operations. Use CPU or CUDA.
fix
Set device='cpu' explicitly when using MPS.
affects: <=0.1.5
deprecatedThe `load_asr` argument in model loading is deprecated. ASR model is now loaded automatically.
fix
Remove `load_asr=True` from `OmniVoice.from_pretrained`.
affects: >=0.1.5
Errors
Common errors & fixes
RuntimeError: Audio length mismatch
Reference audio and text lengths do not align, or audio is too long (>30s recommended).
fix
Trim reference audio to 3-30 seconds and ensure the text corresponds exactly.
AttributeError: module 'torchaudio' has no attribute 'resample'
torchaudio version is too old (<0.12) for resample function.
fix
Install torchaudio >= 0.12: pip install --upgrade torchaudio
ImportError: cannot import name 'OmniVoice' from 'omnivoice'
Incorrect import path; older documentation showed wrong path.
fix
Use 'from omnivoice import OmniVoice' instead of 'from omnivoice.model import OmniVoice'.
ValueError: The truth value of an array with more than one element is ambiguous
Passing stereo audio as reference; expects mono.
fix
Convert reference audio to mono with torchaudio.functional.to_mono().
FileNotFoundError: No such file or directory: 'path/to/model'
Model not downloaded or cache path misconfigured.
fix
Ensure internet connection for first download, or set OMNIVOICE_CACHE_DIR to a valid path.
Upgrade
Version history
0.1.5latest on PyPI · released Apr 28, 2026
Audit
Dependencies
torchrequiredCore dependency for model inference and training.
torchaudiorequiredAudio processing backend; resampling and loading audio files.
transformersrequiredRequired for tokenizer and model components.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
omnivoice — pip install omnivoice · libregistry