Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -164,8 +164,10 @@ def inference(audio_file: str, model_name: str, vocals: bool, drums: bool, bass:
|
|
164 |
|
165 |
# Ensure both segments have the same duration
|
166 |
max_length = max(len(mixed_audio), len(overlay_audio))
|
167 |
-
mixed_audio
|
168 |
-
|
|
|
|
|
169 |
|
170 |
# Overlay the audio
|
171 |
mixed_audio = mixed_audio.overlay(overlay_audio)
|
|
|
164 |
|
165 |
# Ensure both segments have the same duration
|
166 |
max_length = max(len(mixed_audio), len(overlay_audio))
|
167 |
+
if len(mixed_audio) < max_length:
|
168 |
+
mixed_audio += AudioSegment.silent(duration=max_length - len(mixed_audio))
|
169 |
+
if len(overlay_audio) < max_length:
|
170 |
+
overlay_audio += AudioSegment.silent(duration=max_length - len(overlay_audio))
|
171 |
|
172 |
# Overlay the audio
|
173 |
mixed_audio = mixed_audio.overlay(overlay_audio)
|