TigreGotico/voiceclonnx-openvoice-v2
vconnx-openvoice-v2
ONNX export of the OpenVoice v2 tone-color converter (myshell-ai/OpenVoice, MIT license) for use with vconnx — a pure-ONNX zero-shot voice conversion toolkit.
Export details
Both components are exported from the upstream SynthesizerTrn (myshell-ai/OpenVoice) with strict state-dict loading — no architecture reconstruction. The checkpoint loads with 0 missing keys and 0 unexpected keys.
Architecture
The converter includes the full VITS-style flow decoder and HiFi-GAN vocoder; it outputs raw audio directly. No separate vocoder step is needed at inference.
Preprocessing: linear magnitude spectrogram matching upstream spectrogram_torch — Hann window, n_fft=1024, hop=256, win=1024, reflect-pad 384 on each side, sqrt(Re² + Im² + 1e-6). No log compression.
Parity (upstream torch vs ONNX)
The converter max_abs divergence is due to float32 accumulation through 4 residual coupling blocks in the flow — the quality-relevant metric is mean_abs, which passes at 1e-3.
E2E sanity check
Converted a 2 s synthetic source (220 Hz harmonics) to a 330 Hz reference:
Usage
from vconnx import VoiceCloner
cloner = VoiceCloner(engine="openvoice")
cloner.clone_voice("source.wav", "reference.wav", "output.wav")Or with the low-level adapter:
from vconnx.engines.openvoice import OpenVoiceV2Adapter
adapter = OpenVoiceV2Adapter(quantized=False)
adapter.clone_voice("source.wav", "reference.wav", "output.wav")Install with: pip install vconnx[openvoice]
Provenance
- Upstream weights: myshell-ai/OpenVoiceV2
- Upstream source: myshell-ai/OpenVoice
- License: MIT ("Starting from April 2024, both V2 and V1 are released under MIT License. Free for commercial use." — official README)
- Export method: legacy TorchScript ONNX exporter (
dynamo=False), opset 14 (new dynamo exporter fails on GRU) - Strict load: 0 missing keys, 0 unexpected keys
