Voice Conversion with RVC
Convert any recording into a target voice with RVC v2, a cheap, Socaity-hosted voice-conversion model. By the end of this page you will have taken a vocal clip, run it through an RVC model, and saved the converted audio to disk.
Uses: rvc-v2, a cheap, Socaity-hosted voice-conversion model. RVC v2 takes an input audio clip plus a trained RVC model and re-renders the vocals in the target voice, with controls for pitch, f0 method, and feature blending. It runs on Socaity infrastructure, so there is no GPU to manage.
RVC v2 is a catalog model. Install the SDK, then install the model once with the socaity install command. This pulls the pseudoram/rvc-v2 entry into your local catalog.
pip install socaity
socaity install pseudoram/rvc-v2 Import rvc_v2 from its deep path under socaity.sdk.replicate.pseudoram, then construct the client. The SDK reads SOCAITY_API_KEY from the environment automatically; passing api_key= here is optional and overrides the env var.
import os
from socaity.sdk.replicate.pseudoram import rvc_v2
# The SDK reads SOCAITY_API_KEY from the env automatically.
# Passing api_key= here is optional and overrides the env var.
rvc = rvc_v2(api_key=os.getenv("SOCAITY_API_KEY")) Wrap your source file in an AudioFile. This is the SDK media type for audio inputs and follows the same pattern as the handle-files guide. Aim for clean, single-speaker vocals for the best conversion quality.
from socaity import AudioFile
# AudioFile is the SDK media type for audio inputs.
input_audio = AudioFile().from_file("vocals.wav") Call the client with the input audio and a target rvc_model voice, such as "Obama". Set pitch_change to shift the pitch in semitones (0 keeps the original). get_result() blocks until the job finishes and returns a single file, which you then save to disk.
# Convert the vocals into the target voice.
# pitch_change is in semitones; 0 keeps the original pitch.
out = rvc(
input_audio=input_audio,
rvc_model="Obama",
pitch_change=0,
output_format="wav",
).get_result()
# Single output: get_result() returns one file directly.
out.save("converted.wav")
print("Saved converted.wav")get_result() returns one file directly. There is no list to index into, so call .save(...) on it straight away. The complete script, from import to saved file:
import os
from socaity import AudioFile
from socaity.sdk.replicate.pseudoram import rvc_v2
rvc = rvc_v2(api_key=os.getenv("SOCAITY_API_KEY"))
out = rvc(
input_audio=AudioFile().from_file("vocals.wav"),
rvc_model="Obama",
pitch_change=0,
output_format="wav",
).get_result()
out.save("converted.wav")rvc-v2 are not yet exposed in the JS SDK. Use the Python SDK for full model access. The JavaScript SDK reference lists the currently shipping surface. The JavaScript SDK cannot run models yet. Use the Python SDK.
The defaults are tuned for most calls. Reach for these when you need to control pitch, pitch detection, or how strongly the target voice is applied.
| Parameter | Type | Description |
|---|---|---|
input_audio | AudioFile | str | Source audio to convert. Wrap a file with AudioFile().from_file(...). Clean single-speaker vocals work best. |
rvc_model | str | Target voice to convert toward. Built-in voices: Obama, Trump, Sandy, Rogan (default Obama). Set CUSTOM to load your own model via custom_rvc_model_download_url. |
custom_rvc_model_download_url | str | Download URL for a custom RVC model .zip. Required when rvc_model is set to CUSTOM. |
pitch_change | number | Pitch shift in semitones. 0 keeps the original pitch. |
f0_method | str | Pitch (f0) detection method used during conversion. |
index_rate | number | How strongly the target voice character is applied. Higher applies more of the trained model. |
protect | number | Protects breathy and unvoiced consonants from conversion artifacts. |
rms_mix_rate | number | Blends the volume envelope of the output toward the source loudness. |
filter_radius | int | Median filtering radius applied to the detected pitch to reduce breathiness. |
output_format | str | Output audio container, for example wav or mp3. |
The rvc_model is the target voice you are converting toward. Pick a built-in voice (Obama, Trump, Sandy, or Rogan), or set rvc_model="CUSTOM" with custom_rvc_model_download_url="https://.../model.zip" to load your own trained model. Start with pitch_change=0 and adjust in whole semitones if the converted voice sits too high or too low relative to the target.
- Feed clean, single-speaker vocals. Remove instrumental backing first for the clearest conversion.
- Keep
pitch_changeat 0 unless the source and target voices sit in different registers, then shift in whole semitones. - Raise
index_ratetoward 1.0 to apply more of the target voice character; lower it to preserve more of the source. - Use
protectto guard breathy and unvoiced consonants from artifacts. - Pick an
output_formatthat matches your pipeline (for example wav for editing, mp3 for delivery).
- Installed the
rvc-v2catalog model. - Loaded a source recording as an
AudioFile. - Converted the vocals into a target voice with a trained RVC model.
- Saved the converted audio to disk.
- Python SDK reference: full signatures and the catalog model surface.
- Lip sync a character: drive a face animation with audio you converted here.
- Jobs: how
get_result()blocks, the polling default, and the total timeout. - Face swap in 10 lines: the sibling tutorial for the
face2facemodel.