mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-05 17:20:25 +08:00
New feature of real-time voice changing: formant shift adjustment (#1999)
* add formant shift for realtime-gui * chore(i18n): sync locale on dev * chore(format): run black on dev * fix --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
20
gui_v1.py
20
gui_v1.py
@@ -114,6 +114,7 @@ if __name__ == "__main__":
|
||||
self.pth_path: str = ""
|
||||
self.index_path: str = ""
|
||||
self.pitch: int = 0
|
||||
self.formant: float = 0.0
|
||||
self.sr_type: str = "sr_model"
|
||||
self.block_time: float = 0.25 # s
|
||||
self.threhold: int = -60
|
||||
@@ -212,6 +213,7 @@ if __name__ == "__main__":
|
||||
"sr_type": "sr_model",
|
||||
"threhold": -60,
|
||||
"pitch": 0,
|
||||
"formant": 0.0,
|
||||
"index_rate": 0,
|
||||
"rms_mix_rate": 0,
|
||||
"block_time": 0.25,
|
||||
@@ -354,6 +356,17 @@ if __name__ == "__main__":
|
||||
enable_events=True,
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Text(i18n("共振偏移")),
|
||||
sg.Slider(
|
||||
range=(-5, 5),
|
||||
key="formant",
|
||||
resolution=0.01,
|
||||
orientation="h",
|
||||
default_value=data.get("formant", 0.0),
|
||||
enable_events=True,
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Text(i18n("Index Rate")),
|
||||
sg.Slider(
|
||||
@@ -579,6 +592,7 @@ if __name__ == "__main__":
|
||||
],
|
||||
"threhold": values["threhold"],
|
||||
"pitch": values["pitch"],
|
||||
"formant": values["formant"],
|
||||
"rms_mix_rate": values["rms_mix_rate"],
|
||||
"index_rate": values["index_rate"],
|
||||
# "device_latency": values["device_latency"],
|
||||
@@ -621,6 +635,10 @@ if __name__ == "__main__":
|
||||
self.gui_config.pitch = values["pitch"]
|
||||
if hasattr(self, "rvc"):
|
||||
self.rvc.change_key(values["pitch"])
|
||||
elif event == "formant":
|
||||
self.gui_config.formant = values["formant"]
|
||||
if hasattr(self, "rvc"):
|
||||
self.rvc.change_formant(values["formant"])
|
||||
elif event == "index_rate":
|
||||
self.gui_config.index_rate = values["index_rate"]
|
||||
if hasattr(self, "rvc"):
|
||||
@@ -679,6 +697,7 @@ if __name__ == "__main__":
|
||||
]
|
||||
self.gui_config.threhold = values["threhold"]
|
||||
self.gui_config.pitch = values["pitch"]
|
||||
self.gui_config.formant = values["formant"]
|
||||
self.gui_config.block_time = values["block_time"]
|
||||
self.gui_config.crossfade_time = values["crossfade_length"]
|
||||
self.gui_config.extra_time = values["extra_time"]
|
||||
@@ -703,6 +722,7 @@ if __name__ == "__main__":
|
||||
torch.cuda.empty_cache()
|
||||
self.rvc = rtrvc.RVC(
|
||||
self.gui_config.pitch,
|
||||
self.gui_config.formant,
|
||||
self.gui_config.pth_path,
|
||||
self.gui_config.index_path,
|
||||
self.gui_config.index_rate,
|
||||
|
||||
Reference in New Issue
Block a user