From f69c77a94cfb81fd418bedc50f946620a6094d65 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 Nov 2024 21:32:53 +0000 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D1=81=20=D0=BF=D0=BE=D0=BC?= =?UTF-8?q?=D0=BE=D1=89=D1=8C=D1=8E=20black?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rvc/infer/infer.py | 9 +++------ tabs/edge_tts.py | 4 ++-- tabs/inference.py | 4 +++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/rvc/infer/infer.py b/rvc/infer/infer.py index 4373352..fa3c62f 100644 --- a/rvc/infer/infer.py +++ b/rvc/infer/infer.py @@ -105,15 +105,12 @@ def convert_to_stereo(input_path, output_path, output_format): y = np.vstack([y, y]) elif y.ndim > 2: y = y[:2, :] - + # Конвертируем numpy массив в AudioSegment audio_segment = AudioSegment( - y.tobytes(), - frame_rate=sr, - sample_width=y.dtype.itemsize, - channels=2 + y.tobytes(), frame_rate=sr, sample_width=y.dtype.itemsize, channels=2 ) - + # Экспортируем в нужный формат audio_segment.export(output_path, format=output_format) diff --git a/tabs/edge_tts.py b/tabs/edge_tts.py index 4c586ae..e1faf64 100644 --- a/tabs/edge_tts.py +++ b/tabs/edge_tts.py @@ -144,14 +144,14 @@ def edge_tts_tab(): choices=list(edge_voices.keys()), interactive=True, visible=True, - ) + ) voice = gr.Dropdown( value="en-GB-SoniaNeural", label="Голос", choices=["en-GB-SoniaNeural", "en-GB-RyanNeural"], interactive=True, visible=True, - ) + ) with gr.Column(variant="panel", scale=2): with gr.Group(): rvc_model = gr.Dropdown( diff --git a/tabs/inference.py b/tabs/inference.py index 3376480..3c2dfff 100644 --- a/tabs/inference.py +++ b/tabs/inference.py @@ -35,7 +35,9 @@ def voice_pipeline( progress(0, "Запуск конвейера генерации...") base_name = os.path.splitext(os.path.basename(uploaded_file))[0] - voice_convert_path = os.path.join(OUTPUT_DIR, f"{base_name}_(Converted).{output_format}") + voice_convert_path = os.path.join( + OUTPUT_DIR, f"{base_name}_(Converted).{output_format}" + ) progress(0.5, "Преобразование голоса...") rvc_infer(