Spaces:
Running
Running
fix a bug with audio on video speaker separation
Browse files- gradio_app.py +4 -5
gradio_app.py
CHANGED
@@ -121,13 +121,12 @@ def separate_speakers_video(video_path):
|
|
121 |
output_dir = os.path.join("output_sep_video", session_id)
|
122 |
os.makedirs(output_dir, exist_ok=True)
|
123 |
|
124 |
-
|
125 |
for i in range(ests_speech.shape[0]):
|
126 |
path = os.path.join(output_dir, f"speaker_{i+1}.wav")
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
output_videos.append(video_path)
|
131 |
|
132 |
updates = []
|
133 |
for i in range(MAX_SPEAKERS):
|
|
|
121 |
output_dir = os.path.join("output_sep_video", session_id)
|
122 |
os.makedirs(output_dir, exist_ok=True)
|
123 |
|
124 |
+
output_files = []
|
125 |
for i in range(ests_speech.shape[0]):
|
126 |
path = os.path.join(output_dir, f"speaker_{i+1}.wav")
|
127 |
+
audio_np = ests_speech[i].cpu().numpy().astype("float32")
|
128 |
+
sf.write(path, audio_np, TARGET_SR, format='WAV')
|
129 |
+
output_files.append(path)
|
|
|
130 |
|
131 |
updates = []
|
132 |
for i in range(MAX_SPEAKERS):
|