tommy24 commited on
Commit
dc99163
·
1 Parent(s): 73f476c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -18,10 +18,8 @@ def function1(prompt):
18
  }).json()
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.wav")
22
- sound = AudioSegment.from_wav(file_name)
23
- sound.export("speech.mp3", format="mp3")
24
- return file_name
25
 
26
  iface = gr.Interface(fn=function1, inputs="text", outputs=gr.Audio(label="Audio", type="numpy"))
27
  iface.launch()
 
18
  }).json()
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 data
 
 
23
 
24
  iface = gr.Interface(fn=function1, inputs="text", outputs=gr.Audio(label="Audio", type="numpy"))
25
  iface.launch()