Spaces:
Running
Running
ziqiangao
commited on
Commit
·
a561342
1
Parent(s):
921b265
add file validation
Browse files
app.py
CHANGED
@@ -317,6 +317,8 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
|
|
317 |
def gradio_interface(audio_file, lyrics, output_name, fps=30, vidwidth=1280, vidheight=720, oscres=512, img=None, tit=None, ast=None):
|
318 |
if audio_file is None:
|
319 |
raise gr.Error("Please Provide an Audio File")
|
|
|
|
|
320 |
|
321 |
resolution = f"{vidwidth}x{vidheight}"
|
322 |
res = tuple(map(int, resolution.split('x')))
|
|
|
317 |
def gradio_interface(audio_file, lyrics, output_name, fps=30, vidwidth=1280, vidheight=720, oscres=512, img=None, tit=None, ast=None):
|
318 |
if audio_file is None:
|
319 |
raise gr.Error("Please Provide an Audio File")
|
320 |
+
if not str(audio_file).endswith(".mp3"):
|
321 |
+
raise gr.Error("Only MP3 Files are supported at this time")
|
322 |
|
323 |
resolution = f"{vidwidth}x{vidheight}"
|
324 |
res = tuple(map(int, resolution.split('x')))
|