> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-de/audio-and-stimme/rvc-voice-clone.md).

# RVC-Sprachklon

Kopiere und konvertiere Stimmen mit RVC auf Clore.ai-GPUs

Klone und konvertiere Stimmen mit Retrieval-based Voice Conversion.

{% hint style="success" %}
Alle Beispiele können auf GPU-Servern ausgeführt werden, die über [CLORE.AI-Marktplatz](https://clore.ai/marketplace).
{% endhint %}

## Mieten auf CLORE.AI

1. Besuche [CLORE.AI-Marktplatz](https://clore.ai/marketplace)
2. Nach GPU-Typ, VRAM und Preis filtern
3. Wählen Sie **On-Demand** (Festpreis) oder **Spot** (Gebotspreis)
4. Konfiguriere deine Bestellung:
   * Docker-Image auswählen
   * Ports festlegen (TCP für SSH, HTTP für Web-UIs)
   * Umgebungsvariablen hinzufügen, falls nötig
   * Startbefehl eingeben
5. Zahlung auswählen: **CLORE**, **BTC**, oder **USDT/USDC**
6. Bestellung erstellen und auf die Bereitstellung warten

### Auf deinen Server zugreifen

* Verbindungsdetails finden in **Meine Bestellungen**
* Weboberflächen: Verwende die HTTP-Port-URL
* SSH: `ssh -p <port> root@<proxy-address>`

## Was ist RVC?

RVC (Retrieval-based Voice Conversion) kann:

* Jede Stimme mit minimalem Training klonen
* Sing- und Sprechstimmen konvertieren
* Echtzeit-Stimmenkonvertierung
* Hochwertige Ausgabe

## Anforderungen

| Aufgabe  | Min. VRAM | Empfohlen |
| -------- | --------- | --------- |
| Inferenz | 4 GB      | RTX 3060  |
| Training | 8 GB      | RTX 3090  |
| Echtzeit | 6 GB      | RTX 3070  |

## Schnell bereitstellen

**Docker-Image:**

```
pytorch/pytorch:2.11.0-cuda12.8-cudnn9-devel
```

**Ports:**

```
22/tcp
7865/http
```

**Befehl:**

```bash
apt-get update && apt-get install -y ffmpeg git && \
cd /workspace && \
git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git && \
cd Retrieval-based-Voice-Conversion-WebUI && \
pip install -r requirements.txt && \
python infer-web.py --host 0.0.0.0 --port 7865
```

## Auf deinen Dienst zugreifen

Nach der Bereitstellung findest du deine `http_pub` URL in **Meine Bestellungen**:

1. Gehe zu **Meine Bestellungen** Seite
2. Klicke auf deine Bestellung
3. Finde die `http_pub` URL (z. B. `abc123.clorecloud.net`)

Verwende `https://YOUR_HTTP_PUB_URL` anstelle von `localhost` in den folgenden Beispielen.

## Installation

```bash

# Repository klonen
git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
cd Retrieval-based-Voice-Conversion-WebUI

# Abhängigkeiten installieren
pip install -r requirements.txt

# Modelle herunterladen
python tools/download_models.py
```

## Stimmenkonvertierung (Inferenz)

### Mit der Web-UI

1. Öffnen `http://<proxy>:7865`
2. Gehe zum Tab "Modell-Inferenz"
3. Audiodatei hochladen
4. Stimmenmodell auswählen
5. Einstellungen anpassen
6. Klicke auf "Konvertieren"

### Python-API

```python
from infer_pack.models import SynthesizerTrnMs256NSFsid, SynthesizerTrnMs768NSFsid
from vc_infer_pipeline import VC
import torch
import soundfile as sf

# Modell laden
model_path = "./models/my_voice.pth"
index_path = "./models/my_voice.index"

vc = VC(
    model_path=model_path,
    config_path="./configs/v2/48k.json",
    device="cuda"
)

# Audio konvertieren
audio, sr = sf.read("input.wav")
output = vc.convert(
    audio=audio,
    f0_method="rmvpe",  # Methode zur Tonhöhenermittlung
    index_path=index_path,
    index_rate=0.75,
    f0_up_key=0,  # Tonhöhenverschiebung (Halbtöne)
    protect=0.33
)

sf.write("output.wav", output, sr)
```

## Eigene Stimme trainieren

### Datensatz vorbereiten

1. Sammle 10-30 Minuten sauberes Audio
2. In 5-15-Sekunden-Clips schneiden
3. Hintergrundgeräusche/Musik entfernen

```bash

# Audio in Clips aufteilen
ffmpeg -i full_audio.mp3 -f segment -segment_time 10 -c copy clips/clip_%03d.mp3
```

### Training über die Web-UI

1. Gehe zum Tab "Train"
2. Experimentnamen eingeben
3. Pfad des Trainingsordners festlegen
4. Klicke auf "Daten verarbeiten"
5. Klicke auf "Feature-Extraktion"
6. Klicke auf "Trainieren"

### Training über die Kommandozeile

```bash

# Schritt 1: Audio verarbeiten
python trainset_preprocess_pipeline_print.py \\
    "./dataset" \\
    48000 \\
    8 \\
    "./logs/experiment" \\
    False

# Schritt 2: Merkmale extrahieren
python extract_f0_print.py \\
    "./logs/experiment" \\
    8 \\
    "rmvpe"

python extract_feature_print.py \\
    "cuda:0" \\
    "1" \\
    "0" \\
    "0" \\
    "./logs/experiment" \\
    "v2"

# Schritt 3: Trainieren
python train_nsf_sim_cache_sid_load_pretrain.py \\
    -e "experiment" \\
    -sr "48k" \\
    -f0 1 \\
    -bs 8 \\
    -g 0 \\
    -te 200 \\
    -se 20 \\
    -pg "./pretrained/f0G48k.pth" \\
    -pd "./pretrained/f0D48k.pth" \\
    -l 0 \\
    -c 1 \\
    -sw 0 \\
    -v "v2"
```

## Trainingsparameter

| Parameter      | Beschreibung          | Empfohlen |
| -------------- | --------------------- | --------- |
| Abtastrate     | Audioqualität         | 48000     |
| Batchgröße     | Trainings-Batch       | 8-16      |
| Epochen        | Trainingsiterationen  | 200-500   |
| Speichern alle | Checkpoint-Häufigkeit | 20-50     |
| f0-Methode     | Tonhöhenermittlung    | rmvpe     |

## F0-Methoden

| Methode | Qualität  | Geschwindigkeit | Am besten für |
| ------- | --------- | --------------- | ------------- |
| pm      | OK        | Schnell         | Testen        |
| harvest | Gut       | Langsam         | Allgemein     |
| crepe   | Großartig | Mittel          | Singen        |
| rmvpe   | Am besten | Mittel          | Alle          |

## Echtzeit-Konvertierung

### Einrichtung

```python
import pyaudio
import numpy as np
from infer_pack.models import SynthesizerTrnMs256NSFsid
from vc_infer_pipeline import VC

# Initialisieren
vc = VC(model_path="./models/voice.pth", device="cuda")

# Audio-Einrichtung
CHUNK = 1024
FORMAT = pyaudio.paFloat32
CHANNELS = 1
RATE = 48000

p = pyaudio.PyAudio()
stream_in = p.open(format=FORMAT, channels=CHANNELS, rate=RATE,
                   input=True, frames_per_buffer=CHUNK)
stream_out = p.open(format=FORMAT, channels=CHANNELS, rate=RATE,
                    output=True, frames_per_buffer=CHUNK)

# Echtzeit-Schleife
while True:
    audio_in = np.frombuffer(stream_in.read(CHUNK), dtype=np.float32)
    audio_out = vc.convert(audio_in)
    stream_out.write(audio_out.tobytes())
```

## Modellformate

### In ONNX konvertieren

```python
import torch

# PyTorch-Modell laden
model = torch.load("model.pth")

# Nach ONNX exportieren
torch.onnx.export(
    model,
    dummy_input,
    "model.onnx",
    input_names=["audio"],
    output_names=["converted"],
    dynamic_axes={"audio": {0: "length"}}
)
```

## Audio-Vorverarbeitung

### Rauschen entfernen

```python
import noisereduce as nr
import soundfile as sf

audio, sr = sf.read("noisy.wav")
reduced_noise = nr.reduce_noise(y=audio, sr=sr)
sf.write("clean.wav", reduced_noise, sr)
```

### Lautstärke normalisieren

```python
from pydub import AudioSegment

audio = AudioSegment.from_wav("input.wav")
normalized = audio.normalize()
normalized.export("normalized.wav", format="wav")
```

### Stille entfernen

```python
from pydub import AudioSegment
from pydub.silence import split_on_silence

audio = AudioSegment.from_wav("input.wav")
chunks = split_on_silence(audio, min_silence_len=500, silence_thresh=-40)
combined = sum(chunks)
combined.export("no_silence.wav", format="wav")
```

## Stapelverarbeitung

```python
import os
from vc_infer_pipeline import VC
import soundfile as sf

vc = VC(model_path="./models/voice.pth", device="cuda")

input_dir = "./inputs"
output_dir = "./outputs"
os.makedirs(output_dir, exist_ok=True)

for filename in os.listdir(input_dir):
    if filename.endswith(('.wav', '.mp3', '.flac')):
        input_path = os.path.join(input_dir, filename)
        output_path = os.path.join(output_dir, f"converted_{filename}")

        audio, sr = sf.read(input_path)
        converted = vc.convert(audio)
        sf.write(output_path, converted, sr)

        print(f"Converted: {filename}")
```

## Stimmenkonvertierung beim Singen

Für Songs die passenden Einstellungen verwenden:

```python
output = vc.convert(
    audio=audio,
    f0_method="rmvpe",  # Am besten für Gesang
    index_rate=0.5,     # Niedriger für Gesang
    f0_up_key=-2,       # Tonhöhe anpassen, damit sie passt
    protect=0.5         # Konsonanten schützen
)
```

## Häufige Probleme

### Stimme klingt roboterhaft

* Verwende Quellaudio höherer Qualität
* Erhöhe den protect-Wert (0.4-0.5)
* Versuche eine andere f0-Methode

### Tonhöhenprobleme

* f0\_up\_key anpassen
* Verwende die rmvpe-f0-Methode
* Achte auf konsistente Tonhöhe in den Trainingsdaten

### Audioqualität

* Verwende 48 kHz Abtastrate
* Entferne Hintergrundgeräusche aus den Trainingsdaten
* Trainiere über mehr Epochen

## API-Server

```python
from fastapi import FastAPI, UploadFile
from fastapi.responses import FileResponse
from vc_infer_pipeline import VC
import soundfile as sf
import tempfile

app = FastAPI()
vc = VC(model_path="./models/voice.pth", device="cuda")

@app.post("/convert")
async def convert_voice(file: UploadFile, pitch: int = 0):
    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_in:
        content = await file.read()
        tmp_in.write(content)
        tmp_in_path = tmp_in.name

    audio, sr = sf.read(tmp_in_path)
    converted = vc.convert(audio, f0_up_key=pitch)

    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_out:
        sf.write(tmp_out.name, converted, sr)
        return FileResponse(tmp_out.name, media_type="audio/wav")
```

## Trainingstipps

### Für bessere Qualität

* Verwende 20+ Minuten sauberes Audio
* Entferne alle Hintergrundgeräusche
* Einheitliches Mikrofon-/Aufnahme-Setup
* Verschiedene Ausdrücke/Emotionen einbeziehen

### Für schnelleres Training

* Verwende eine Batchgröße von 8-16
* Aktiviere Mixed Precision
* Verwende eine NVMe-SSD für den Datensatz

## Leistung

| Aufgabe                      | GPU      | Zeit          |
| ---------------------------- | -------- | ------------- |
| Inferenz (1 Min. Audio)      | RTX 3090 | \~5 s         |
| Training (30-Min.-Datensatz) | RTX 3090 | \~2 Stunden   |
| Echtzeit-Konvertierung       | RTX 3070 | <50 ms Latenz |

## Fehlerbehebung

## Kostenschätzung

Übliche CLORE.AI-Marktplatzpreise (Stand 2024):

| GPU       | Stundensatz | Tagessatz | 4-Stunden-Sitzung |
| --------- | ----------- | --------- | ----------------- |
| RTX 3060  | \~$0.03     | \~$0.70   | \~$0.12           |
| RTX 3090  | \~$0.06     | \~$1.50   | \~$0.25           |
| RTX 4090  | \~$0.10     | \~$2.30   | \~$0.40           |
| A100 40GB | \~$0.17     | \~$4.00   | \~$0.70           |
| A100 80GB | \~$0.25     | \~$6.00   | \~$1.00           |

*Die Preise variieren je nach Anbieter und Nachfrage. Prüfen Sie* [*CLORE.AI-Marktplatz*](https://clore.ai/marketplace) *die aktuellen Preise.*

**Sparen Sie Geld:**

* Nutzen Sie den **Spot** Markt für unterbrechbare Arbeit — etwa ein Drittel der Server bietet Spot-Preise unter On-Demand (Median ca. 13 % Rabatt), der Rest ist gleich teuer
* Bezahlen Sie mit **CLORE** Token
* Preise verschiedener Anbieter vergleichen

## Nächste Schritte

* [Bark TTS](/guides/guides_v2-de/audio-and-stimme/bark-tts.md) - Text-zu-Sprache
* [AudioCraft Music](/guides/guides_v2-de/audio-and-stimme/audiocraft-music.md) - Musikerzeugung
* [Whisper-Transkription](/guides/guides_v2-de/audio-and-stimme/whisper-transcription.md) - Sprache-zu-Text


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-de/audio-and-stimme/rvc-voice-clone.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
