Spaces:
Running
Running
Add Length Limit
Browse filesAdded Length Limit because someone decided to upload a 30min clip
app.py
CHANGED
@@ -375,6 +375,11 @@ def gradio_interface(audio_file, lyrics, output_name, fps=30, vidwidth=1280, vid
|
|
375 |
if not str(audio_file).endswith(".mp3"):
|
376 |
raise gr.Error("Only MP3 Files are supported at this time")
|
377 |
|
|
|
|
|
|
|
|
|
|
|
378 |
resolution = f"{vidwidth}x{vidheight}"
|
379 |
res = tuple(map(int, resolution.split('x')))
|
380 |
video_file, haslyrics = main(audio_file, output_name, fps=fps,
|
|
|
375 |
if not str(audio_file).endswith(".mp3"):
|
376 |
raise gr.Error("Only MP3 Files are supported at this time")
|
377 |
|
378 |
+
# Check MP3 duration limit (15 min = 900 sec)
|
379 |
+
audio = MP3(audio_file.name)
|
380 |
+
if audio.info.length > 900:
|
381 |
+
raise gr.Error("The uploaded MP3 file exceeds the 15-minute limit. Please upload a shorter file.")
|
382 |
+
|
383 |
resolution = f"{vidwidth}x{vidheight}"
|
384 |
res = tuple(map(int, resolution.split('x')))
|
385 |
video_file, haslyrics = main(audio_file, output_name, fps=fps,
|