1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

fix: resolve inconsistent sample rates

ref https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/pull/2234
This commit is contained in:
源文雨
2024-08-14 20:57:01 +08:00
parent bf41d8bafd
commit 0884d286a9

18
web.py
View File

@@ -449,7 +449,7 @@ def change_version19(sr2, if_f0_3, version19):
to_return_sr2 = ( to_return_sr2 = (
{"choices": ["40k", "48k"], "__type__": "update", "value": sr2} {"choices": ["40k", "48k"], "__type__": "update", "value": sr2}
if version19 == "v1" if version19 == "v1"
else {"choices": ["40k", "48k", "32k"], "__type__": "update", "value": sr2} else {"choices": ["32k", "40k", "48k"], "__type__": "update", "value": sr2}
) )
f0_str = "f0" if if_f0_3 else "" f0_str = "f0" if if_f0_3 else ""
return ( return (
@@ -557,7 +557,7 @@ def click_train(
logger.info("No pretrained Generator") logger.info("No pretrained Generator")
if pretrained_D15 == "": if pretrained_D15 == "":
logger.info("No pretrained Discriminator") logger.info("No pretrained Discriminator")
if version19 == "v1" or sr2 == "40k": if version19 == "v1" or sr2 == "40k": # v2 40k falls back to v1
config_path = "v1/%s.json" % sr2 config_path = "v1/%s.json" % sr2
else: else:
config_path = "v2/%s.json" % sr2 config_path = "v2/%s.json" % sr2
@@ -1201,8 +1201,8 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Row(): with gr.Row():
sr2 = gr.Radio( sr2 = gr.Radio(
label=i18n("Target sample rate"), label=i18n("Target sample rate"),
choices=["40k", "48k"], choices=["32k", "40k", "48k"],
value="40k", value="48k",
interactive=True, interactive=True,
) )
if_f0_3 = gr.Radio( if_f0_3 = gr.Radio(
@@ -1363,12 +1363,12 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Column(): with gr.Column():
pretrained_G14 = gr.Textbox( pretrained_G14 = gr.Textbox(
label=i18n("Load pre-trained base model G path"), label=i18n("Load pre-trained base model G path"),
value="assets/pretrained_v2/f0G40k.pth", value="assets/pretrained_v2/f0G48k.pth",
interactive=True, interactive=True,
) )
pretrained_D15 = gr.Textbox( pretrained_D15 = gr.Textbox(
label=i18n("Load pre-trained base model D path"), label=i18n("Load pre-trained base model D path"),
value="assets/pretrained_v2/f0D40k.pth", value="assets/pretrained_v2/f0D48k.pth",
interactive=True, interactive=True,
) )
gpus16 = gr.Textbox( gpus16 = gr.Textbox(
@@ -1497,8 +1497,8 @@ with gr.Blocks(title="RVC WebUI") as app:
with gr.Column(): with gr.Column():
sr_ = gr.Radio( sr_ = gr.Radio(
label=i18n("Target sample rate"), label=i18n("Target sample rate"),
choices=["40k", "48k"], choices=["32k", "40k", "48k"],
value="40k", value="48k",
interactive=True, interactive=True,
) )
if_f0_ = gr.Radio( if_f0_ = gr.Radio(
@@ -1609,7 +1609,7 @@ with gr.Blocks(title="RVC WebUI") as app:
sr__ = gr.Radio( sr__ = gr.Radio(
label=i18n("Target sample rate"), label=i18n("Target sample rate"),
choices=["32k", "40k", "48k"], choices=["32k", "40k", "48k"],
value="40k", value="48k",
interactive=True, interactive=True,
) )
if_f0__ = gr.Radio( if_f0__ = gr.Radio(