mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-02-12 00:22:50 +08:00
Merge pull request #1660 from RVC-Project/formatter-dev
chore(format): run black on dev
This commit is contained in:
commit
4769472ba2
24
gui_v1.py
24
gui_v1.py
@ -14,6 +14,7 @@ import multiprocessing
|
|||||||
|
|
||||||
flag_vc = False
|
flag_vc = False
|
||||||
|
|
||||||
|
|
||||||
def printt(strr, *args):
|
def printt(strr, *args):
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
print(strr)
|
print(strr)
|
||||||
@ -153,16 +154,24 @@ if __name__ == "__main__":
|
|||||||
data["rmvpe"] = data["f0method"] == "rmvpe"
|
data["rmvpe"] = data["f0method"] == "rmvpe"
|
||||||
data["fcpe"] = data["f0method"] == "fcpe"
|
data["fcpe"] = data["f0method"] == "fcpe"
|
||||||
if data["sg_input_device"] not in self.input_devices:
|
if data["sg_input_device"] not in self.input_devices:
|
||||||
data["sg_input_device"] = self.input_devices[self.input_devices_indices.index(sd.default.device[0])]
|
data["sg_input_device"] = self.input_devices[
|
||||||
|
self.input_devices_indices.index(sd.default.device[0])
|
||||||
|
]
|
||||||
if data["sg_output_device"] not in self.output_devices:
|
if data["sg_output_device"] not in self.output_devices:
|
||||||
data["sg_output_device"] = self.output_devices[self.output_devices_indices.index(sd.default.device[1])]
|
data["sg_output_device"] = self.output_devices[
|
||||||
|
self.output_devices_indices.index(sd.default.device[1])
|
||||||
|
]
|
||||||
except:
|
except:
|
||||||
with open("configs/config.json", "w") as j:
|
with open("configs/config.json", "w") as j:
|
||||||
data = {
|
data = {
|
||||||
"pth_path": "",
|
"pth_path": "",
|
||||||
"index_path": "",
|
"index_path": "",
|
||||||
"sg_input_device": self.input_devices[self.input_devices_indices.index(sd.default.device[0])],
|
"sg_input_device": self.input_devices[
|
||||||
"sg_output_device": self.output_devices[self.output_devices_indices.index(sd.default.device[1])],
|
self.input_devices_indices.index(sd.default.device[0])
|
||||||
|
],
|
||||||
|
"sg_output_device": self.output_devices[
|
||||||
|
self.output_devices_indices.index(sd.default.device[1])
|
||||||
|
],
|
||||||
"sr_type": "sr_model",
|
"sr_type": "sr_model",
|
||||||
"threhold": -60,
|
"threhold": -60,
|
||||||
"pitch": 0,
|
"pitch": 0,
|
||||||
@ -737,7 +746,8 @@ if __name__ == "__main__":
|
|||||||
callback=self.audio_callback,
|
callback=self.audio_callback,
|
||||||
blocksize=self.block_frame,
|
blocksize=self.block_frame,
|
||||||
samplerate=self.gui_config.samplerate,
|
samplerate=self.gui_config.samplerate,
|
||||||
dtype="float32")
|
dtype="float32",
|
||||||
|
)
|
||||||
self.stream.start()
|
self.stream.start()
|
||||||
|
|
||||||
def stop_stream(self):
|
def stop_stream(self):
|
||||||
@ -950,6 +960,8 @@ if __name__ == "__main__":
|
|||||||
printt("Output device: %s:%s", str(sd.default.device[1]), output_device)
|
printt("Output device: %s:%s", str(sd.default.device[1]), output_device)
|
||||||
|
|
||||||
def get_device_samplerate(self):
|
def get_device_samplerate(self):
|
||||||
return int(sd.query_devices(device=sd.default.device[0])['default_samplerate'])
|
return int(
|
||||||
|
sd.query_devices(device=sd.default.device[0])["default_samplerate"]
|
||||||
|
)
|
||||||
|
|
||||||
gui = GUI()
|
gui = GUI()
|
||||||
|
Loading…
Reference in New Issue
Block a user