Update app.py
Browse files
app.py
CHANGED
@@ -22,12 +22,12 @@ def function1(prompt):
|
|
22 |
file_name, headers = urllib.request.urlretrieve(data, "speech.mp3")
|
23 |
# code = random.randint(1,1000)
|
24 |
# generated_file = f"output{code}"
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
command = f"ffmpeg -i {file_name} -vn -ar 44100 -ac 2 -b:a 192k output.mp3"
|
32 |
os.system(command)
|
33 |
return "output.mp3"
|
|
|
22 |
file_name, headers = urllib.request.urlretrieve(data, "speech.mp3")
|
23 |
# code = random.randint(1,1000)
|
24 |
# generated_file = f"output{code}"
|
25 |
+
filename = "output.mp3"
|
26 |
|
27 |
+
if os.path.exists(filename):
|
28 |
+
os.remove(filename)
|
29 |
+
else:
|
30 |
+
pass
|
31 |
command = f"ffmpeg -i {file_name} -vn -ar 44100 -ac 2 -b:a 192k output.mp3"
|
32 |
os.system(command)
|
33 |
return "output.mp3"
|