How daswer123/rvc-python works
Project Type and Purpose
• This is a Python-based voice conversion toolkit (RVC Python) that provides:
• A command-line interface (CLI) for batch or single-file processing
• A Python library for embedding in other applications
• An HTTP API server for remote/in-process inference
• Its core function is to load a pre-trained voice conversion model, run audio through a configurable inference pipeline (feature extraction, pitch prediction, synthesis), and output converted audio.
File Structure Analysis
• Top-level:
• rvc_python/ – main package
• README.md, pyproject.toml, requirements.txt – metadata & dependencies
• test.py – ad hoc script (likely for quick tests)
• rvc_python/__main__.py – entrypoint dispatching to CLI or API
• rvc_python/api.py – HTTP server implementation and route definitions
• rvc_python/infer.py & infer_old.py – high-level inference class (RVCInference) and older variant
• rvc_python/download_model.py – model downloader
• rvc_python/configs/… – JSON config templates for model versions (v1/v2) and sample rates
• rvc_python/lib/ – shared utilities:
• audio.py – I/O and waveform helpers
• globals.py – global constants
• infer_pack/ – backend-agnostic inference modules (Torch, ONNX, DML)
• jit/ – functions to JIT-compile submodules (hubert, rmvpe, synthesizer)
• rvc_python/modules/ – specialized modules:
• ipex/ – Intel-extension hooks for attention, gradscaler, hijacks
• onnx/ – ONNX export helpers
• train/ – preprocessing scripts for training
• vc/ – core conversion pipeline modules and utilities
README Insights
• Describes CLI and API modes, model management, configurable parameters, GPU setup.
• Lists API endpoints for conversion, model loading/listing, parameter get/set, model upload, device selection.
• Highlights dynamic model loading/unloading and support for CPU/GPU.