Update app.py
Browse files
app.py
CHANGED
@@ -49,9 +49,8 @@ def mp4_to_wav_or_mp3(mp4fileuploader, file_format, random_filename):
|
|
49 |
output_filename = "convertedaudio.mp3" if not random_filename else f"convertedaudio_{random.randint(1000, 9999)}.mp3"
|
50 |
videoinput.write_audiofile(output_filename)
|
51 |
videoinput.close()
|
52 |
-
what_to_return = "convertedaudio.wav" if file_format == "wav" else "convertedaudio.mp3"
|
53 |
os.remove(mp4fileuploader)
|
54 |
-
return "Converted mp4 file successfully!",
|
55 |
except:
|
56 |
raise gr.Error(traceback.format_exc())
|
57 |
|
|
|
49 |
output_filename = "convertedaudio.mp3" if not random_filename else f"convertedaudio_{random.randint(1000, 9999)}.mp3"
|
50 |
videoinput.write_audiofile(output_filename)
|
51 |
videoinput.close()
|
|
|
52 |
os.remove(mp4fileuploader)
|
53 |
+
return "Converted mp4 file successfully!", output_filename
|
54 |
except:
|
55 |
raise gr.Error(traceback.format_exc())
|
56 |
|