amirgame197 commited on
Commit
8268997
1 Parent(s): 35526a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -23,18 +23,17 @@ def separate_audio(audio_path):
23
  print(result)
24
  subprocess.run((f"ffmpeg -y -i {gradio_temp_path}/{audio_filename}/accompaniment.wav {gradio_temp_path}/{audio_filename}/accompaniment.mp3").split())
25
  subprocess.run((f"ffmpeg -y -i {gradio_temp_path}/{audio_filename}/vocals.wav {gradio_temp_path}/{audio_filename}/vocals.mp3").split())
26
-
27
- paths = []
28
- paths.append(gradio_temp_path + f"/{audio_filename}/accompaniment.mp3")
29
- paths.append(gradio_temp_path + f"/{audio_filename}/vocals.mp3")
30
- return [gr.Audio(path) for path in paths]
31
 
32
  iface = gr.Interface(
33
  fn=separate_audio,
34
  title="Professional(😂) One click music vocal extraction using Spleeter",
35
  description="Usage Example: you can import the vocal to one of those voice changers then combine instrument with the result to get the normal music but with a changed vocal!",
36
  inputs=[gr.Audio(type="filepath", label="Audio File")],
37
- outputs=[gr.Audio(label='Accompaniment'), gr.Audio(label='Vocals')],
38
  live=True
39
  )
40
 
 
23
  print(result)
24
  subprocess.run((f"ffmpeg -y -i {gradio_temp_path}/{audio_filename}/accompaniment.wav {gradio_temp_path}/{audio_filename}/accompaniment.mp3").split())
25
  subprocess.run((f"ffmpeg -y -i {gradio_temp_path}/{audio_filename}/vocals.wav {gradio_temp_path}/{audio_filename}/vocals.mp3").split())
26
+
27
+ accompaniment_path = os.path.join(gradio_temp_path, audio_filename, "accompaniment.mp3")
28
+ vocals_path = os.path.join(gradio_temp_path, audio_filename, "vocals.mp3")
29
+ return accompaniment_path, vocals_path
 
30
 
31
  iface = gr.Interface(
32
  fn=separate_audio,
33
  title="Professional(😂) One click music vocal extraction using Spleeter",
34
  description="Usage Example: you can import the vocal to one of those voice changers then combine instrument with the result to get the normal music but with a changed vocal!",
35
  inputs=[gr.Audio(type="filepath", label="Audio File")],
36
+ outputs=[gr.Audio(type="filepath", label='Accompaniment'), gr.Audio(type="filepath", label='Vocals')],
37
  live=True
38
  )
39