Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,26 +22,14 @@ def separate_audio(audio_path):
|
|
| 22 |
print(result)
|
| 23 |
|
| 24 |
paths = []
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/vocals.wav")
|
| 28 |
-
elif stem_count == 4 or stem_count == 5:
|
| 29 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/vocals.wav")
|
| 30 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/drums.wav")
|
| 31 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/bass.wav")
|
| 32 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/other.wav")
|
| 33 |
-
if stem_count == 5:
|
| 34 |
-
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/piano.wav")
|
| 35 |
-
|
| 36 |
-
# Return the audio file paths as a list of Audio components
|
| 37 |
return [gr.Audio(path) for path in paths]
|
| 38 |
|
| 39 |
-
# Define the Gradio interface
|
| 40 |
iface = gr.Interface(
|
| 41 |
fn=separate_audio,
|
| 42 |
-
inputs=[gr.Audio(type="filepath")],
|
| 43 |
outputs=[gr.Audio(label='Accompaniment'), gr.Audio(label='Vocals')]
|
| 44 |
)
|
| 45 |
|
| 46 |
-
# Launch the interface
|
| 47 |
iface.launch()
|
|
|
|
| 22 |
print(result)
|
| 23 |
|
| 24 |
paths = []
|
| 25 |
+
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/accompaniment.wav")
|
| 26 |
+
paths.append(gradio_temp_path + f"/separated_audio/{audio_filename}/vocals.wav")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
return [gr.Audio(path) for path in paths]
|
| 28 |
|
|
|
|
| 29 |
iface = gr.Interface(
|
| 30 |
fn=separate_audio,
|
| 31 |
+
inputs=[gr.Audio(type="filepath", label="Audio File")],
|
| 32 |
outputs=[gr.Audio(label='Accompaniment'), gr.Audio(label='Vocals')]
|
| 33 |
)
|
| 34 |
|
|
|
|
| 35 |
iface.launch()
|