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

chore(format): run black on dev (#121)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-06-19 17:56:04 +09:00
committed by GitHub
parent 64f994be82
commit 3b4a546ced
7 changed files with 60 additions and 64 deletions

29
gui.py
View File

@@ -885,12 +885,12 @@ if __name__ == "__main__":
self.stream = AudioIoProcess(
input_device=sd.default.device[0],
output_device=sd.default.device[1],
input_audio_block_size = self.block_frame,
sample_rate = self.gui_config.samplerate,
input_audio_block_size=self.block_frame,
sample_rate=self.gui_config.samplerate,
channel_num=self.gui_config.channels,
is_input_wasapi_exclusive=wasapi_exclusive,
is_output_wasapi_exclusive=wasapi_exclusive,
is_device_combined = True
is_device_combined=True,
# TODO: Add control UI to allow devices with different type API & different WASAPI settings
)
self.in_mem = SharedMemory(name=self.stream.get_in_mem_name())
@@ -899,19 +899,17 @@ if __name__ == "__main__":
self.stream.get_np_shape(),
dtype=self.stream.get_np_dtype(),
buffer=self.in_mem.buf,
order='C'
order="C",
)
self.out_buf = np.ndarray(
self.stream.get_np_shape(),
dtype=self.stream.get_np_dtype(),
buffer=self.out_mem.buf,
order='C'
order="C",
)
self.in_ptr, self.out_ptr, self.play_ptr, self.in_evt, self.stop_evt = (
self.stream.get_ptrs_and_events()
)
self.in_ptr, \
self.out_ptr, \
self.play_ptr, \
self.in_evt, \
self.stop_evt = self.stream.get_ptrs_and_events()
self.stream.start()
@@ -919,10 +917,7 @@ if __name__ == "__main__":
while flag_vc:
self.audio_infer(self.block_frame << 1)
threading.Thread(
target=audio_loop,
daemon=True
).start()
threading.Thread(target=audio_loop, daemon=True).start()
def stop_stream(self):
global flag_vc
@@ -936,9 +931,7 @@ if __name__ == "__main__":
self.stream.join()
self.stream = None
def audio_infer(
self, buf_size:int # 2 * self.block_frame
):
def audio_infer(self, buf_size: int): # 2 * self.block_frame
"""
音频处理
"""
@@ -947,7 +940,7 @@ if __name__ == "__main__":
self.in_evt.wait()
rptr = self.in_ptr.value
self.in_evt.clear()
start_time = time.perf_counter()
rend = rptr + self.block_frame