tommy24 commited on
Commit
8ea6338
·
1 Parent(s): 2044244

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -19,7 +19,9 @@ def function1(prompt):
19
  data = response["data"][0]["name"]
20
  data = "https://matthijs-speecht5-tts-demo.hf.space/file="+data
21
  file_name, headers = urllib.request.urlretrieve(data, "speech.mp3")
22
- return "speech.mp3"
 
 
23
 
24
- iface = gr.Interface(fn=function1, inputs="text", outputs="text")
25
  iface.launch()
 
19
  data = response["data"][0]["name"]
20
  data = "https://matthijs-speecht5-tts-demo.hf.space/file="+data
21
  file_name, headers = urllib.request.urlretrieve(data, "speech.mp3")
22
+ command = f"ffmpeg -i {file_name} -vn -ar 44100 -ac 2 -b:a 192k output.mp3"
23
+ os.system(command)
24
+ return "output.mp3"
25
 
26
+ iface = gr.Interface(fn=function1, inputs="text", outputs=[gr.Audio(label="Audio",type="numpy")])
27
  iface.launch()