Skip to content

Voice Conversion with RVC

Beginner
5 min

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.

Step 1. Install the model

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.

terminal
pip install socaity
socaity install pseudoram/rvc-v2

Step 2. Import and initialise

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.

python
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"))

Step 3. Load the input audio

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.

python
from socaity import AudioFile

# AudioFile is the SDK media type for audio inputs.
input_audio = AudioFile().from_file("vocals.wav")

Step 4. Convert the voice and save

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.

python
# 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")

Full example

The complete script, from import to saved file:

python
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")

JavaScript alternative

The JavaScript SDK cannot run models yet. Use the Python SDK.

Parameters

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.

ParameterTypeDescription
input_audioAudioFile | strSource audio to convert. Wrap a file with AudioFile().from_file(...). Clean single-speaker vocals work best.
rvc_modelstrTarget 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_urlstrDownload URL for a custom RVC model .zip. Required when rvc_model is set to CUSTOM.
pitch_changenumberPitch shift in semitones. 0 keeps the original pitch.
f0_methodstrPitch (f0) detection method used during conversion.
index_ratenumberHow strongly the target voice character is applied. Higher applies more of the trained model.
protectnumberProtects breathy and unvoiced consonants from conversion artifacts.
rms_mix_ratenumberBlends the volume envelope of the output toward the source loudness.
filter_radiusintMedian filtering radius applied to the detected pitch to reduce breathiness.
output_formatstrOutput 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.

Tips for best results

  • Feed clean, single-speaker vocals. Remove instrumental backing first for the clearest conversion.
  • Keep pitch_change at 0 unless the source and target voices sit in different registers, then shift in whole semitones.
  • Raise index_rate toward 1.0 to apply more of the target voice character; lower it to preserve more of the source.
  • Use protect to guard breathy and unvoiced consonants from artifacts.
  • Pick an output_format that matches your pipeline (for example wav for editing, mp3 for delivery).

What you built

  • Installed the rvc-v2 catalog 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.

Next steps