Update app.py
Browse files
app.py
CHANGED
@@ -22,15 +22,15 @@ 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 |
-
filename = "output.mp3"
|
26 |
|
27 |
-
if os.path.exists(filename):
|
28 |
-
|
29 |
-
else:
|
30 |
-
|
31 |
command = f"ffmpeg -i {file_name} -vn -ar 44100 -ac 2 -b:a 192k output.mp3"
|
32 |
os.system(command)
|
33 |
-
return
|
34 |
|
35 |
iface = gr.Interface(fn=function1, inputs="text", outputs=[gr.Audio(label="Audio",type="numpy")])
|
36 |
iface.launch()
|
|
|
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"
|
34 |
|
35 |
iface = gr.Interface(fn=function1, inputs="text", outputs=[gr.Audio(label="Audio",type="numpy")])
|
36 |
iface.launch()
|