Update README.md
Browse files
README.md
CHANGED
|
@@ -34,32 +34,32 @@ pip install git+https://github.com/One-sixth/fairseq.git
|
|
| 34 |
|
| 35 |
Below is an example of how to use rvc-inferpy in your Python project:
|
| 36 |
```
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
-
#
|
| 40 |
-
converter
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
|
|
|
|
| 44 |
|
| 45 |
-
# Path to the input audio file
|
| 46 |
-
audio_path = "input_audio.wav"
|
| 47 |
|
| 48 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
output_path = converter.infer_audio(
|
| 50 |
-
voice_model=
|
| 51 |
-
audio_path=
|
| 52 |
-
f0_change=0, # Pitch change (in semitones)
|
| 53 |
-
f0_method="rmvpe+", # Pitch estimation method
|
| 54 |
-
split_infer=False, # Whether to split audio based on silence
|
| 55 |
-
index_rate=0.75, # Index rate (adjusts voice timbre)
|
| 56 |
-
filter_radius=3, # Filter smoothing radius
|
| 57 |
-
resample_sr=0, # Resample audio (0 keeps original sample rate)
|
| 58 |
-
protect=0.33, # Protect voiced consonants from distortion
|
| 59 |
)
|
| 60 |
|
| 61 |
-
|
| 62 |
-
print(f"Generated voice conversion output: {output_path}")
|
| 63 |
```
|
| 64 |
The infer_audio function returns the processed audio object based on the provided parameters.
|
| 65 |
|
|
|
|
| 34 |
|
| 35 |
Below is an example of how to use rvc-inferpy in your Python project:
|
| 36 |
```
|
| 37 |
+
# Method 1: Direct import
|
| 38 |
+
from rvc_inferpy.converter import RVCConverter
|
| 39 |
|
| 40 |
+
# Method 2: Import with alias
|
| 41 |
+
from rvc_inferpy.converter import RVCConverter as VoiceConverter
|
| 42 |
|
| 43 |
+
# Method 3: Import entire module
|
| 44 |
+
import rvc_inferpy.converter
|
| 45 |
+
converter = rvc_inferpy.converter.RVCConverter()
|
| 46 |
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
# Create an instance
|
| 49 |
+
converter = RVCConverter(
|
| 50 |
+
device="cuda:0", # GPU device (or "cpu" if no GPU)
|
| 51 |
+
is_half=True, # Use half precision
|
| 52 |
+
models_dir=MODELS_DIR, # Directory containing models
|
| 53 |
+
download_if_missing=True # Download models if not found
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
# Use the converter
|
| 57 |
output_path = converter.infer_audio(
|
| 58 |
+
voice_model="your_model_name",
|
| 59 |
+
audio_path="input_audio.wav"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
)
|
| 61 |
|
| 62 |
+
|
|
|
|
| 63 |
```
|
| 64 |
The infer_audio function returns the processed audio object based on the provided parameters.
|
| 65 |
|