sudo-soldier commited on
Commit
2505d33
·
verified ·
1 Parent(s): bfd6745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -37,9 +37,9 @@ def process_youtube_or_audio(url, uploaded_audio, start_time, end_time):
37
  # Process uploaded audio file
38
  elif uploaded_audio:
39
  print("Processing uploaded audio...")
40
- filename = uploaded_audio.name
41
  song_name = "uploaded_audio"
42
-
43
  if not filename or not os.path.exists(filename):
44
  print(f"Error: No valid file found at {filename}") # Debug
45
  return None, None
@@ -107,7 +107,7 @@ with gr.Blocks(css="""
107
 
108
  with gr.Column(scale=1, min_width=250):
109
  gr.HTML('<label><i class="fas fa-upload"></i>&nbsp;Upload Audio</label>')
110
- audio_upload = gr.File(label="Upload Audio", type="filepath", show_label=False)
111
 
112
  with gr.Row():
113
  gr.HTML("<h3>Trim Audio (Optional)</h3>")
@@ -133,3 +133,4 @@ with gr.Blocks(css="""
133
  process_button.click(process_youtube_or_audio, inputs=[youtube_url, audio_upload, start_time, end_time], outputs=[mp3_download, iphone_ringtone])
134
 
135
  interface.launch(share=True)
 
 
37
  # Process uploaded audio file
38
  elif uploaded_audio:
39
  print("Processing uploaded audio...")
40
+ filename = uploaded_audio.name # Using the uploaded file's name
41
  song_name = "uploaded_audio"
42
+
43
  if not filename or not os.path.exists(filename):
44
  print(f"Error: No valid file found at {filename}") # Debug
45
  return None, None
 
107
 
108
  with gr.Column(scale=1, min_width=250):
109
  gr.HTML('<label><i class="fas fa-upload"></i>&nbsp;Upload Audio</label>')
110
+ audio_upload = gr.File(label="Upload Audio", type="file", show_label=False) # Correct type
111
 
112
  with gr.Row():
113
  gr.HTML("<h3>Trim Audio (Optional)</h3>")
 
133
  process_button.click(process_youtube_or_audio, inputs=[youtube_url, audio_upload, start_time, end_time], outputs=[mp3_download, iphone_ringtone])
134
 
135
  interface.launch(share=True)
136
+