Spaces:
Running
Running
Update app.py
Browse files
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> Upload Audio</label>')
|
110 |
-
audio_upload = gr.File(label="Upload Audio", type="
|
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> 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 |
+
|