Awell00 commited on
Commit
32f933c
·
verified ·
1 Parent(s): fc6aab1

fix: format of return audio

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -172,7 +172,7 @@ def delete_folders_and_files(input_dir):
172
  print("Cleanup completed.")
173
 
174
  @spaces.GPU(duration=300) # Adjust the duration as needed
175
- def process_audio(uploaded_file, output_format):
176
  try:
177
  yield "Processing audio...", None
178
 
@@ -207,7 +207,7 @@ def process_audio(uploaded_file, output_format):
207
  move_stems_to_parent(OUTPUT_FOLDER)
208
 
209
  yield "Combining stems...", None
210
- output_file = combine_stems_for_all(OUTPUT_FOLDER, output_format)
211
 
212
  yield "Cleaning up...", None
213
  delete_folders_and_files(OUTPUT_FOLDER)
@@ -221,8 +221,7 @@ def process_audio(uploaded_file, output_format):
221
  with gr.Blocks() as demo:
222
  gr.Markdown("# Music Player and Processor")
223
 
224
- file_upload = gr.File(label="Upload WAV file", file_types=[f".{output_format}"])
225
- output_format = gr.Dropdown(label="Select Output Format", choices=["wav", "m4a"], value="m4a")
226
 
227
  process_button = gr.Button("Process Audio")
228
 
@@ -231,7 +230,7 @@ with gr.Blocks() as demo:
231
 
232
  process_button.click(
233
  fn=process_audio,
234
- inputs=[file_upload, output_format],
235
  outputs=[log_output, processed_audio_output],
236
  show_progress=True
237
  )
 
172
  print("Cleanup completed.")
173
 
174
  @spaces.GPU(duration=300) # Adjust the duration as needed
175
+ def process_audio(uploaded_file):
176
  try:
177
  yield "Processing audio...", None
178
 
 
207
  move_stems_to_parent(OUTPUT_FOLDER)
208
 
209
  yield "Combining stems...", None
210
+ output_file = combine_stems_for_all(OUTPUT_FOLDER, "m4a")
211
 
212
  yield "Cleaning up...", None
213
  delete_folders_and_files(OUTPUT_FOLDER)
 
221
  with gr.Blocks() as demo:
222
  gr.Markdown("# Music Player and Processor")
223
 
224
+ file_upload = gr.File(label="Upload WAV file")
 
225
 
226
  process_button = gr.Button("Process Audio")
227
 
 
230
 
231
  process_button.click(
232
  fn=process_audio,
233
+ inputs=file_upload,
234
  outputs=[log_output, processed_audio_output],
235
  show_progress=True
236
  )