mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-08-29 01:59:23 +02:00
Add bilingual VST developer guides and MIT license
This commit is contained in:
@@ -1,13 +1,21 @@
|
|||||||
RVC Realtime Plugin
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 RVC Realtime contributors
|
Copyright (c) 2026 RVC-BOSS
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
Third-party components retain their respective notices and terms under third_party.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|||||||
289
RVCRealtimeVST/README.en.md
Normal file
289
RVCRealtimeVST/README.en.md
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
# RVC Realtime VST Developer Guide
|
||||||
|
|
||||||
|
[English](./README.en.md) | [简体中文](./README.md)
|
||||||
|
|
||||||
|
RVC Realtime VST is a Windows x64 real-time voice conversion plug-in project. The same source tree builds both VST2 and VST3 formats.
|
||||||
|
|
||||||
|
The plug-in is implemented in C++17 with iPlug2. Model loading and RVC inference run in a separate Python worker process. The host audio thread only handles audio buffers, mixing, and lock-free queue operations.
|
||||||
|
|
||||||
|
This directory does not include a Python runtime, RVC models, index files, training data, or a complete RVC runtime package. None of these runtime files are required to compile the plug-in.
|
||||||
|
|
||||||
|
## Supported targets
|
||||||
|
|
||||||
|
- Windows 10/11 x64
|
||||||
|
- 64-bit VST2 DLL
|
||||||
|
- 64-bit VST3 bundle
|
||||||
|
- Mono input/output, mono-to-stereo, and stereo input/output
|
||||||
|
- RMVPE, FCPE, and PM F0 methods
|
||||||
|
- External 64-bit RVC Python runtime
|
||||||
|
- `.pth` models and optional `.index` files
|
||||||
|
- 64-bit VST hosts such as Studio One
|
||||||
|
|
||||||
|
Windows x86, macOS, and Linux plug-in targets are not currently configured.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
DAW["64-bit DAW"] --> Plugin["VST2/VST3 C++ plug-in"]
|
||||||
|
Plugin --> InputRing["Lock-free input ring buffer"]
|
||||||
|
InputRing --> Bridge["WorkerClient management thread"]
|
||||||
|
Bridge <--> IPC["Shared memory + Windows Events"]
|
||||||
|
IPC <--> Worker["Separate Python worker"]
|
||||||
|
Worker --> RVC["External RVC source, model, and CUDA runtime"]
|
||||||
|
Worker --> IPC
|
||||||
|
Bridge --> OutputRing["Lock-free output ring buffer"]
|
||||||
|
OutputRing --> Plugin
|
||||||
|
Plugin --> DAW
|
||||||
|
```
|
||||||
|
|
||||||
|
The plug-in starts the package's `runtime\python.exe` with `CreateProcessW` and executes the bundled `worker\rvc_worker.py`. Audio is transferred through Windows shared memory. Named Events synchronize requests and responses. Audio is not transported through network ports, HTTP, or ordinary stdin/stdout pipes.
|
||||||
|
|
||||||
|
The Python worker imports the following modules from the RVC root selected by the user:
|
||||||
|
|
||||||
|
```text
|
||||||
|
configs/config.py
|
||||||
|
infer/rtrvc.py
|
||||||
|
tools/cuda_graph.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Source layout
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtimeVST/
|
||||||
|
|-- CMakeLists.txt
|
||||||
|
|-- config.h
|
||||||
|
|-- src/ Plug-in, UI, state, and IPC source
|
||||||
|
|-- worker/rvc_worker.py Python/RVC inference bridge
|
||||||
|
|-- resources/ Windows resources, font, and user guide
|
||||||
|
|-- scripts/
|
||||||
|
| |-- prepare-dependencies.ps1 Validate and prepare locked dependencies
|
||||||
|
| |-- build.ps1 Build and create the release ZIP
|
||||||
|
| |-- test-all.ps1 VST2, VST3, and optional CUDA tests
|
||||||
|
| `-- test-worker.ps1 Real RVC worker test
|
||||||
|
|-- tools/ VST2 and worker smoke-test source
|
||||||
|
`-- third_party/ Git submodules, compatibility header, licenses
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build requirements
|
||||||
|
|
||||||
|
Install the following components:
|
||||||
|
|
||||||
|
- 64-bit Windows 10 or Windows 11
|
||||||
|
- Visual Studio 2022 or Build Tools 2022
|
||||||
|
- The Visual Studio "Desktop development with C++" workload
|
||||||
|
- MSVC v143
|
||||||
|
- A Windows 10/11 SDK
|
||||||
|
- CMake 3.14 or newer
|
||||||
|
- Windows PowerShell 5.1 or PowerShell 7
|
||||||
|
- Git
|
||||||
|
- Access to GitHub and NuGet during the first configuration
|
||||||
|
|
||||||
|
Verified build environment:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Windows 10 22H2 x64
|
||||||
|
MSVC 19.39.33521
|
||||||
|
Windows SDK 10.0.20348.0
|
||||||
|
CMake 3.26.6
|
||||||
|
```
|
||||||
|
|
||||||
|
The following components are not required to compile the plug-in binaries:
|
||||||
|
|
||||||
|
- System Python
|
||||||
|
- An RVC runtime package
|
||||||
|
- PyTorch
|
||||||
|
- CUDA Toolkit
|
||||||
|
- An NVIDIA GPU
|
||||||
|
- Model or index files
|
||||||
|
|
||||||
|
The first iPlug2 CMake configuration downloads WIL and the WebView2 SDK. Subsequent builds can reuse the CMake cache.
|
||||||
|
|
||||||
|
## Clone the complete source tree
|
||||||
|
|
||||||
|
A recursive clone is recommended. GitHub's Download ZIP archive does not contain the actual submodule contents.
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git config --global core.longpaths true
|
||||||
|
git clone --recursive https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
|
||||||
|
cd Retrieval-based-Voice-Conversion-WebUI\RVCRealtimeVST
|
||||||
|
```
|
||||||
|
|
||||||
|
For an existing non-recursive clone, run:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
Enabling `core.longpaths` is recommended on Windows because iPlug2 and the VST3 SDK contain deeply nested directories.
|
||||||
|
|
||||||
|
## Locked dependency revisions
|
||||||
|
|
||||||
|
| Dependency | Commit |
|
||||||
|
| --- | --- |
|
||||||
|
| iPlug2 | `5c2df9dce3f5258acfeff3846a6a9563f382212c` |
|
||||||
|
| Steinberg VST3 SDK | `58f8da7936800732561402d7936584ca4505de07` |
|
||||||
|
| Xaymar VST2 SDK | `339d4f31590bf77c0d0d248e09a380ac6285e069` |
|
||||||
|
|
||||||
|
The VST3 SDK gitlinks additionally lock `base`, `cmake`, `pluginterfaces`, and `public.sdk`. `prepare-dependencies.ps1` validates the outer revisions and initializes the required nested modules.
|
||||||
|
|
||||||
|
## Build VST2 and VST3
|
||||||
|
|
||||||
|
Run this command from the `RVCRealtimeVST` directory:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\build.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
The script performs these steps:
|
||||||
|
|
||||||
|
1. Verify that the three submodules match the locked revisions.
|
||||||
|
2. Initialize the required nested VST3 SDK modules.
|
||||||
|
3. Prepare the VST2 and VST3 SDK layout expected by iPlug2.
|
||||||
|
4. Generate a Visual Studio 2022 x64 CMake project.
|
||||||
|
5. Build the Release VST2 and VST3 targets.
|
||||||
|
6. Copy the worker resources using relative paths.
|
||||||
|
7. Create `dist\RVCRealtime-Win64.zip`.
|
||||||
|
|
||||||
|
Primary outputs:
|
||||||
|
|
||||||
|
```text
|
||||||
|
dist/RVC Realtime.dll
|
||||||
|
dist/RVCRealtime.resources/worker/rvc_worker.py
|
||||||
|
dist/RVCRealtime.vst3/
|
||||||
|
dist/RVCRealtime-Win64.zip
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
### Format tests without an RVC runtime
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-all.ps1 -SkipWorker
|
||||||
|
```
|
||||||
|
|
||||||
|
This command runs the VST2 dynamic loading and audio processing smoke test, then builds and runs the Steinberg VST3 Validator.
|
||||||
|
|
||||||
|
### Real RVC worker test
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-worker.ps1 `
|
||||||
|
-RvcRoot "D:\path\to\RVC-package" `
|
||||||
|
-Model "D:\path\to\model.pth" `
|
||||||
|
-Index "D:\path\to\model.index"
|
||||||
|
```
|
||||||
|
|
||||||
|
`-Python` is optional and defaults to `<RvcRoot>\runtime\python.exe`. `-Index` is also optional.
|
||||||
|
|
||||||
|
Run the complete test suite with:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-all.ps1 `
|
||||||
|
-RvcRoot "D:\path\to\RVC-package" `
|
||||||
|
-Model "D:\path\to\model.pth" `
|
||||||
|
-Index "D:\path\to\model.index"
|
||||||
|
```
|
||||||
|
|
||||||
|
## RVC runtime requirements
|
||||||
|
|
||||||
|
At runtime, the user must provide a separate RVC package containing both source code and a Python environment. At minimum, it must provide:
|
||||||
|
|
||||||
|
```text
|
||||||
|
runtime/python.exe 64-bit Python
|
||||||
|
configs/config.py
|
||||||
|
infer/rtrvc.py
|
||||||
|
tools/cuda_graph.py
|
||||||
|
model files *.pth
|
||||||
|
index files *.index optional
|
||||||
|
```
|
||||||
|
|
||||||
|
Verified runtime versions:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Python 3.12.10 x64
|
||||||
|
PyTorch 2.7.1+cu118
|
||||||
|
Torchaudio 2.7.1+cu118
|
||||||
|
NumPy 1.26.4
|
||||||
|
Librosa 0.10.2.post1
|
||||||
|
```
|
||||||
|
|
||||||
|
These are verified versions, not strict minimum versions. A package that bundles Python, PyTorch, and the CUDA runtime does not require a system Python installation and usually does not require a separate CUDA Toolkit installation. A compatible NVIDIA driver is still required.
|
||||||
|
|
||||||
|
## Relative paths in release packages
|
||||||
|
|
||||||
|
VST2 loads its worker from a directory next to the DLL:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtime.resources/worker/rvc_worker.py
|
||||||
|
```
|
||||||
|
|
||||||
|
VST3 loads its worker from inside the bundle:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtime.vst3/Contents/Resources/worker/rvc_worker.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The source directory, developer RVC path, and test model paths are not compiled into the release plug-ins.
|
||||||
|
|
||||||
|
## User configuration and logs
|
||||||
|
|
||||||
|
The last successfully started path configuration is stored at:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%LOCALAPPDATA%\RVCRealtime\settings.ini
|
||||||
|
```
|
||||||
|
|
||||||
|
Temporary worker JSON, process output, and exception logs are stored at:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%TEMP%\RVCRealtime\logs\
|
||||||
|
```
|
||||||
|
|
||||||
|
The plug-in uses Unicode-safe Windows file APIs and supports non-ASCII usernames and paths.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- Block: `20-1000 ms`
|
||||||
|
- Crossfade: `10-100 ms`
|
||||||
|
- Context: `500-3000 ms`
|
||||||
|
- Effective SOLA overlap: `min(Crossfade, 40 ms)`
|
||||||
|
- Reported plug-in latency: twice the Block duration in sample frames
|
||||||
|
|
||||||
|
Changes to Block, Crossfade, Context, sample rate, or runtime paths rebuild the Python worker. Pitch, Formant, Index, RMS Mix, Gate, and F0 method values are transferred through shared memory while the worker is running.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### CMake reports missing submodules
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
Run `scripts\build.ps1` again after the submodules have been initialized.
|
||||||
|
|
||||||
|
### Windows reports that a filename or path is too long
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git config --global core.longpaths true
|
||||||
|
```
|
||||||
|
|
||||||
|
Cloning to a shorter location such as `D:\src\RVC` can also help.
|
||||||
|
|
||||||
|
### The plug-in remains on LOADING MODEL or displays ERROR
|
||||||
|
|
||||||
|
Inspect:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%TEMP%\RVCRealtime\logs\instance_*.json.process.log
|
||||||
|
%TEMP%\RVCRealtime\logs\instance_*.json.log
|
||||||
|
```
|
||||||
|
|
||||||
|
Also verify the RVC root, 64-bit Python executable, model, optional index, and NVIDIA driver.
|
||||||
|
|
||||||
|
### Rebuild after source changes
|
||||||
|
|
||||||
|
Run `scripts\build.ps1` again. CMake reuses the `build` directory for incremental builds. For a completely fresh configuration, remove the locally generated `build` and `dist` directories before running the build script.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Project code in this directory is licensed under the MIT License in `LICENSE.txt`. Third-party components retain their own licenses and copyright notices. See `THIRD_PARTY_NOTICES.md` and the license files in each submodule.
|
||||||
289
RVCRealtimeVST/README.md
Normal file
289
RVCRealtimeVST/README.md
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
# RVC Realtime VST 开发说明
|
||||||
|
|
||||||
|
[简体中文](./README.md) | [English](./README.en.md)
|
||||||
|
|
||||||
|
RVC Realtime VST 是面向 Windows x64 的实时变声插件工程,可从同一套源码构建 VST2 和 VST3。
|
||||||
|
|
||||||
|
插件本体使用 C++17 和 iPlug2。模型加载与 RVC 推理由独立的 Python worker 进程执行,宿主音频线程只负责音频缓冲、混音和无锁队列操作。
|
||||||
|
|
||||||
|
本目录不包含 Python runtime、RVC 模型、索引、训练数据或完整 RVC 整合包。编译插件不需要这些运行时文件。
|
||||||
|
|
||||||
|
## 当前支持范围
|
||||||
|
|
||||||
|
- Windows 10/11 x64
|
||||||
|
- 64 位 VST2 DLL
|
||||||
|
- 64 位 VST3 bundle
|
||||||
|
- Mono 输入输出、Mono 到 Stereo、Stereo 输入输出
|
||||||
|
- RMVPE、FCPE、PM 三种 F0 方法
|
||||||
|
- 外部 64 位 RVC Python runtime
|
||||||
|
- `.pth` 模型和可选 `.index` 文件
|
||||||
|
- Studio One 等 64 位 VST 宿主
|
||||||
|
|
||||||
|
当前工程未配置 Windows x86、macOS 或 Linux 插件目标。
|
||||||
|
|
||||||
|
## 工作原理
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
DAW["64 位 DAW"] --> Plugin["VST2/VST3 C++ 插件"]
|
||||||
|
Plugin --> InputRing["输入无锁环形缓冲"]
|
||||||
|
InputRing --> Bridge["WorkerClient 管理线程"]
|
||||||
|
Bridge <--> IPC["共享内存 + Windows Event"]
|
||||||
|
IPC <--> Worker["独立 Python worker"]
|
||||||
|
Worker --> RVC["外部 RVC 源码、模型与 CUDA 环境"]
|
||||||
|
Worker --> IPC
|
||||||
|
Bridge --> OutputRing["输出无锁环形缓冲"]
|
||||||
|
OutputRing --> Plugin
|
||||||
|
Plugin --> DAW
|
||||||
|
```
|
||||||
|
|
||||||
|
插件通过 `CreateProcessW` 启动整合包中的 `runtime\python.exe`,并执行插件自带的 `worker\rvc_worker.py`。音频数据通过 Windows 共享内存传递,请求和响应通过命名 Event 同步,不使用网络端口、HTTP 或普通 stdin/stdout 管道传输音频。
|
||||||
|
|
||||||
|
Python worker 从用户选择的 RVC 根目录导入:
|
||||||
|
|
||||||
|
```text
|
||||||
|
configs/config.py
|
||||||
|
infer/rtrvc.py
|
||||||
|
tools/cuda_graph.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## 源码结构
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtimeVST/
|
||||||
|
├─ CMakeLists.txt
|
||||||
|
├─ config.h
|
||||||
|
├─ src/ 插件、界面、状态和 IPC 源码
|
||||||
|
├─ worker/rvc_worker.py Python/RVC 推理桥接
|
||||||
|
├─ resources/ Windows 资源、字体和用户安装说明
|
||||||
|
├─ scripts/
|
||||||
|
│ ├─ prepare-dependencies.ps1 校验并准备锁定依赖
|
||||||
|
│ ├─ build.ps1 构建并生成发布 ZIP
|
||||||
|
│ ├─ test-all.ps1 VST2、VST3 和可选 CUDA 测试
|
||||||
|
│ └─ test-worker.ps1 真实 RVC worker 测试
|
||||||
|
├─ tools/ VST2 和 worker smoke test 源码
|
||||||
|
└─ third_party/ git submodule、兼容头和许可证
|
||||||
|
```
|
||||||
|
|
||||||
|
## 编译环境
|
||||||
|
|
||||||
|
必须安装:
|
||||||
|
|
||||||
|
- Windows 10 或 Windows 11 64 位
|
||||||
|
- Visual Studio 2022 或 Build Tools 2022
|
||||||
|
- Visual Studio 工作负载“使用 C++ 的桌面开发”
|
||||||
|
- MSVC v143
|
||||||
|
- Windows 10/11 SDK
|
||||||
|
- CMake 3.14 或更高版本
|
||||||
|
- Windows PowerShell 5.1 或 PowerShell 7
|
||||||
|
- Git
|
||||||
|
- 首次配置时可访问 GitHub 和 NuGet
|
||||||
|
|
||||||
|
已验证的编译环境:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Windows 10 22H2 x64
|
||||||
|
MSVC 19.39.33521
|
||||||
|
Windows SDK 10.0.20348.0
|
||||||
|
CMake 3.26.6
|
||||||
|
```
|
||||||
|
|
||||||
|
编译插件本体不需要:
|
||||||
|
|
||||||
|
- 系统 Python
|
||||||
|
- RVC 整合包
|
||||||
|
- PyTorch
|
||||||
|
- CUDA Toolkit
|
||||||
|
- NVIDIA GPU
|
||||||
|
- 模型或索引
|
||||||
|
|
||||||
|
iPlug2 的首次 CMake 配置会获取 WIL 和 WebView2 SDK,因此首次构建需要网络。后续可复用 CMake 缓存。
|
||||||
|
|
||||||
|
## 获取完整源码
|
||||||
|
|
||||||
|
推荐使用递归 clone。GitHub 网页上的“Download ZIP”不包含 submodule 的实际内容。
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git config --global core.longpaths true
|
||||||
|
git clone --recursive https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
|
||||||
|
cd Retrieval-based-Voice-Conversion-WebUI\RVCRealtimeVST
|
||||||
|
```
|
||||||
|
|
||||||
|
已有普通 clone 时执行:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
Windows 建议提前启用 `core.longpaths`,因为 iPlug2 和 VST3 SDK 中存在较深的目录结构。
|
||||||
|
|
||||||
|
## 锁定的依赖版本
|
||||||
|
|
||||||
|
| 依赖 | 提交 |
|
||||||
|
| --- | --- |
|
||||||
|
| iPlug2 | `5c2df9dce3f5258acfeff3846a6a9563f382212c` |
|
||||||
|
| Steinberg VST3 SDK | `58f8da7936800732561402d7936584ca4505de07` |
|
||||||
|
| Xaymar VST2 SDK | `339d4f31590bf77c0d0d248e09a380ac6285e069` |
|
||||||
|
|
||||||
|
VST3 SDK 所需的 `base`、`cmake`、`pluginterfaces` 和 `public.sdk` 由 VST3 SDK 自身的 gitlink 继续锁定。`prepare-dependencies.ps1` 会校验外层提交并初始化必要的嵌套模块。
|
||||||
|
|
||||||
|
## 编译 VST2 和 VST3
|
||||||
|
|
||||||
|
在 `RVCRealtimeVST` 目录执行:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\build.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
脚本会依次:
|
||||||
|
|
||||||
|
1. 检查三个 submodule 的提交是否与锁定版本一致。
|
||||||
|
2. 初始化必要的 VST3 SDK 嵌套模块。
|
||||||
|
3. 准备 iPlug2 需要的 VST2/VST3 SDK 目录结构。
|
||||||
|
4. 使用 Visual Studio 2022 x64 生成 CMake 工程。
|
||||||
|
5. 构建 Release 版 VST2 和 VST3。
|
||||||
|
6. 复制相对路径 worker 资源。
|
||||||
|
7. 生成 `dist\RVCRealtime-Win64.zip`。
|
||||||
|
|
||||||
|
主要输出:
|
||||||
|
|
||||||
|
```text
|
||||||
|
dist/RVC Realtime.dll
|
||||||
|
dist/RVCRealtime.resources/worker/rvc_worker.py
|
||||||
|
dist/RVCRealtime.vst3/
|
||||||
|
dist/RVCRealtime-Win64.zip
|
||||||
|
```
|
||||||
|
|
||||||
|
## 测试
|
||||||
|
|
||||||
|
### 不使用 RVC runtime 的格式测试
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-all.ps1 -SkipWorker
|
||||||
|
```
|
||||||
|
|
||||||
|
该命令执行 VST2 动态加载和音频处理 smoke test,并构建和运行 Steinberg VST3 Validator。
|
||||||
|
|
||||||
|
### 真实 RVC worker 测试
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-worker.ps1 `
|
||||||
|
-RvcRoot "D:\path\to\RVC-package" `
|
||||||
|
-Model "D:\path\to\model.pth" `
|
||||||
|
-Index "D:\path\to\model.index"
|
||||||
|
```
|
||||||
|
|
||||||
|
`-Python` 可省略,此时默认使用 `<RvcRoot>\runtime\python.exe`。`-Index` 也可省略。
|
||||||
|
|
||||||
|
执行完整测试:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\scripts\test-all.ps1 `
|
||||||
|
-RvcRoot "D:\path\to\RVC-package" `
|
||||||
|
-Model "D:\path\to\model.pth" `
|
||||||
|
-Index "D:\path\to\model.index"
|
||||||
|
```
|
||||||
|
|
||||||
|
## RVC 运行环境要求
|
||||||
|
|
||||||
|
插件运行时需要用户另外准备包含源码和 Python 环境的 RVC 整合包。至少需要:
|
||||||
|
|
||||||
|
```text
|
||||||
|
runtime/python.exe 64 位 Python
|
||||||
|
configs/config.py
|
||||||
|
infer/rtrvc.py
|
||||||
|
tools/cuda_graph.py
|
||||||
|
模型文件 *.pth
|
||||||
|
索引文件 *.index 可选
|
||||||
|
```
|
||||||
|
|
||||||
|
当前已验证的 runtime 版本:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Python 3.12.10 x64
|
||||||
|
PyTorch 2.7.1+cu118
|
||||||
|
Torchaudio 2.7.1+cu118
|
||||||
|
NumPy 1.26.4
|
||||||
|
Librosa 0.10.2.post1
|
||||||
|
```
|
||||||
|
|
||||||
|
这些是已验证版本,不代表全部最低版本。使用自带 Python、PyTorch 和 CUDA 运行库的整合包时,不需要安装系统 Python,也通常不需要另外安装 CUDA Toolkit;仍需要兼容的 NVIDIA 驱动。
|
||||||
|
|
||||||
|
## 发布包中的相对路径
|
||||||
|
|
||||||
|
VST2 从 DLL 同级目录读取:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtime.resources/worker/rvc_worker.py
|
||||||
|
```
|
||||||
|
|
||||||
|
VST3 从 bundle 内读取:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RVCRealtime.vst3/Contents/Resources/worker/rvc_worker.py
|
||||||
|
```
|
||||||
|
|
||||||
|
源码目录、开发机 RVC 路径和测试模型路径不会编译进发布插件。
|
||||||
|
|
||||||
|
## 用户配置与日志
|
||||||
|
|
||||||
|
最后一次成功启动的路径配置保存在:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%LOCALAPPDATA%\RVCRealtime\settings.ini
|
||||||
|
```
|
||||||
|
|
||||||
|
临时 worker JSON、进程输出和异常日志保存在:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%TEMP%\RVCRealtime\logs\
|
||||||
|
```
|
||||||
|
|
||||||
|
插件使用宽字符 Windows 文件接口,支持中文用户名和中文路径。
|
||||||
|
|
||||||
|
## 参数说明
|
||||||
|
|
||||||
|
- Block:`20-1000 ms`
|
||||||
|
- Crossfade:`10-100 ms`
|
||||||
|
- Context:`500-3000 ms`
|
||||||
|
- 实际 SOLA overlap:`min(Crossfade, 40 ms)`
|
||||||
|
- 插件报告延迟:两倍 Block 对应的采样帧数
|
||||||
|
|
||||||
|
Block、Crossfade、Context、采样率或运行路径变化会重建 Python worker。Pitch、Formant、Index、RMS Mix、Gate 和 F0 方法会在运行期间通过共享内存传递。
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
### CMake 提示 submodule 缺失
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
然后重新运行 `scripts\build.ps1`。
|
||||||
|
|
||||||
|
### Windows 提示文件名或路径过长
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git config --global core.longpaths true
|
||||||
|
```
|
||||||
|
|
||||||
|
也可把仓库 clone 到更短的路径,例如 `D:\src\RVC`。
|
||||||
|
|
||||||
|
### 插件停留在 LOADING MODEL 或显示 ERROR
|
||||||
|
|
||||||
|
检查:
|
||||||
|
|
||||||
|
```text
|
||||||
|
%TEMP%\RVCRealtime\logs\instance_*.json.process.log
|
||||||
|
%TEMP%\RVCRealtime\logs\instance_*.json.log
|
||||||
|
```
|
||||||
|
|
||||||
|
同时确认 RVC 根目录、64 位 Python、模型、索引以及 NVIDIA 驱动均有效。
|
||||||
|
|
||||||
|
### 修改后如何重新构建
|
||||||
|
|
||||||
|
直接再次运行 `scripts\build.ps1`。CMake 会复用 `build` 目录进行增量编译。需要完全重新配置时,删除本地生成的 `build` 和 `dist` 后再执行构建脚本。
|
||||||
|
|
||||||
|
## 许可证
|
||||||
|
|
||||||
|
本目录的项目代码使用 `LICENSE.txt` 中的 MIT 许可证。第三方组件保留各自许可证和版权声明,详见 `THIRD_PARTY_NOTICES.md` 与各 submodule 内的许可证文件。
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
#define PLUG_MFR_ID 'Rvcp'
|
#define PLUG_MFR_ID 'Rvcp'
|
||||||
#define PLUG_URL_STR "https://github.com/iPlug2/iPlug2"
|
#define PLUG_URL_STR "https://github.com/iPlug2/iPlug2"
|
||||||
#define PLUG_EMAIL_STR ""
|
#define PLUG_EMAIL_STR ""
|
||||||
#define PLUG_COPYRIGHT_STR "Copyright 2026 RVC Realtime contributors"
|
#define PLUG_COPYRIGHT_STR "Copyright 2026 RVC-BOSS"
|
||||||
#define PLUG_CLASS_NAME RVCRealtime
|
#define PLUG_CLASS_NAME RVCRealtime
|
||||||
|
|
||||||
#define BUNDLE_NAME "RVCRealtime"
|
#define BUNDLE_NAME "RVCRealtime"
|
||||||
|
|||||||
Reference in New Issue
Block a user