tommy24 commited on
Commit
059cb5d
·
1 Parent(s): a1af113

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- 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 f"https://tommy24-testing45.hf.space/file=output.mp3"
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()