OmniVoiceEngine wraps k2-fsa/OmniVoice for local multilingual voice cloning.
It requires a reference audio file and exact transcript.
pip install "realtimetts[omnivoice]"Install a compatible PyTorch build for your CUDA or CPU environment. The source import error suggests:
pip install torch torchaudio omnivoicefrom RealtimeTTS import TextToAudioStream, OmniVoiceEngine, OmniVoiceVoice
if __name__ == "__main__":
voice = OmniVoiceVoice(
name="demo",
ref_audio="reference.wav",
ref_text="Exact transcript of the reference audio.",
language="en",
)
engine = OmniVoiceEngine(voice=voice)
stream = TextToAudioStream(engine)
stream.feed("Hello from OmniVoice.")
stream.play()- Default model is
k2-fsa/OmniVoice. - Default
device_mapiscuda:0and default dtype istorch.float16. num_steps_scheduledefaults to[12, 32]; the first sentence uses the first value and later sentences reuse later values.preprocess_promptandpostprocess_outputare forwarded to generation.- Output is mono 16-bit PCM at 24000 Hz.
- Isolated venv smoke tests found OmniVoice needed the
emotional_wavsreference assets. - Later speed tuning did not promote OmniVoice above the faster local paths in that environment.
OmniVoiceEngine requires a voice configuration: pass anOmniVoiceVoicewith bothref_audioandref_text.- If CUDA memory is tight, reduce steps or test CPU only for correctness first.