Skip to content

Commit

Permalink
Автоматическое форматирование кода (#40)
Browse files Browse the repository at this point in the history
Автоматическое форматирование кода с помощью black
  • Loading branch information
Bebra777228 authored Nov 9, 2024
2 parents 1437b3a + f69c77a commit f8bf3d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 3 additions & 6 deletions rvc/infer/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tabs/edge_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion tabs/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f8bf3d3

Please sign in to comment.