rvc_inferpy
v0.5.7-beta
筆記
該項目仍在開發中。
rvc_inferpy是一個用於使用RVC(基於檢索的語音轉換)執行音頻推理的Python庫。它提供了一個簡單的命令行界面(CLI),並且可以集成到使用可自定義參數的音頻處理的Python項目中。
您可以使用pip安裝軟件包:
pip install rvc-inferpy您可以通過命令行與rvc_inferpy進行交互。要查看可用選項以及如何使用該工具,請運行:
rvc-cli -h這是完整命令行選項的細分:
usage: rvc-cli [-h] [--model_name MODEL_NAME] [--audio_path AUDIO_PATH]
[--f0_change F0_CHANGE] [--f0_method F0_METHOD]
[--min_pitch MIN_PITCH] [--max_pitch MAX_PITCH]
[--crepe_hop_length CREPE_HOP_LENGTH] [--index_rate INDEX_RATE]
[--filter_radius FILTER_RADIUS] [--rms_mix_rate RMS_MIX_RATE]
[--protect PROTECT] [--split_infer] [--min_silence MIN_SILENCE]
[--silence_threshold SILENCE_THRESHOLD] [--seek_step SEEK_STEP]
[--keep_silence KEEP_SILENCE] [--do_formant] [--quefrency QUEFRENCY]
[--timbre TIMBRE] [--f0_autotune] [--audio_format AUDIO_FORMAT]
[--resample_sr RESAMPLE_SR] -h, --help :顯示幫助消息和退出。--model_name MODEL_NAME :模型的名稱或路徑。--audio_path AUDIO_PATH :輸入音頻文件的路徑。--f0_change F0_CHANGE :音高變化因子。--f0_method F0_METHOD :F0估計方法(例如,“ crepe”)。--min_pitch MIN_PITCH :最小音高值。--max_pitch MAX_PITCH :最大音高值。--crepe_hop_length CREPE_HOP_LENGTH :crepe hop長度。--index_rate INDEX_RATE :索引速率。--filter_radius FILTER_RADIUS :濾鏡半徑。--rms_mix_rate RMS_MIX_RATE :RMS混合速率。--protect PROTECT :保護因素避免失真。--split_infer :啟用拆分推理。--min_silence MIN_SILENCE :最小沉默持續時間(以秒為單位)。--silence_threshold SILENCE_THRESHOLD :db中的沉默閾值。--seek_step SEEK_STEP :靜音檢測的步驟大小。--keep_silence KEEP_SILENCE :持續時間保持沉默(以秒為單位)。--do_formant :啟用共振劑處理。--quefrency QUEFRENCY :Quefrency調整。--timbre TIMBRE :音色調整因子。--f0_autotune :啟用自動F0調整。--audio_format AUDIO_FORMAT :所需的輸出音頻格式(例如,“ wav”,“ mp3”)。--resample_sr RESAMPLE_SR :重新樣本樣本率。rvc-cli --model_name " model_name_here " --audio_path " path_to_audio.wav " --f0_change 0 --f0_method " crepe " --min_pitch 50 --max_pitch 800您也可以在Python項目中直接使用rvc_inferpy 。這是一個例子:
from rvc_inferpy import infer_audio
inferred_audio = infer_audio (
MODEL_NAME = "model_name_here" , # Name or path to the RVC model
SOUND_PATH = "path_to_audio.wav" , # Path to the input audio file
F0_CHANGE = 0 , # Change in fundamental frequency
F0_METHOD = "crepe" , # F0 extraction method ("crepe", "dio", etc.)
MIN_PITCH = 50 , # Minimum pitch value
MAX_PITCH = 800 , # Maximum pitch value
CREPE_HOP_LENGTH = 128 , # Hop length for Crepe
INDEX_RATE = 1.0 , # Index rate for model inference
FILTER_RADIUS = 3 , # Radius for smoothing filters
RMS_MIX_RATE = 0.75 , # Mixing rate for RMS
PROTECT = 0.33 , # Protect level to prevent overfitting
SPLIT_INFER = True , # Whether to split audio for inference
MIN_SILENCE = 0.5 , # Minimum silence duration for splitting
SILENCE_THRESHOLD = - 40 , # Silence threshold in dB
SEEK_STEP = 10 , # Seek step in milliseconds
KEEP_SILENCE = 0.1 , # Keep silence duration in seconds
QUEFRENCY = 0.0 , # Cepstrum quefrency adjustment
TIMBRE = 1.0 , # Timbre preservation level
F0_AUTOTUNE = False , # Enable or disable F0 autotuning
OUTPUT_FORMAT = "wav" # Desired output format (e.g., "wav", "mp3")
) infer_audio函數將根據提供的參數返回處理後的音頻對象
from rvc_inferpy import infernew
infer = infernew(
model_name="model_name_here",
sound_path="path_to_audio.wav",
f0_change=0
)
output_audio = infer.run_inference()
print("Inference completed:", output_audio)
您還可以使用自己的RVC模型下載
from rvc_inferpy import download_rvc_model dlrvc
dlrvc("URL_HERE", "model_name")
筆記
Downloas型號僅允許Huggingface, Google Drive, and Pixeldrain鏈接。
提示
確保您將模型上傳到models/{model_name}文件夾中。
禁止將轉換的語音用於以下目的。
批評或攻擊個人。
倡導或反對特定的政治立場,宗教或意識形態。
公開表現出強烈的刺激表達式,而無需進行適當的分區。
銷售語音模型和生成的語音剪輯。
冒充聲音的原始主人,以惡意傷害/傷害他人的意圖。
導致身份盜用或欺詐性電話的欺詐目的。
我對與使用/濫用或無法使用此軟件有關的任何直接,間接,結果,附帶或特殊損害不承擔任何責任。
該項目已根據MIT許可獲得許可。