Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,8 @@ def text_to_speech(text):
|
|
6 |
test = os.environ.get("test")
|
7 |
endpoint = f"https://api.voicerss.org/?key={test}&src={text}&hl=en-us"
|
8 |
response = requests.get(endpoint)
|
9 |
-
|
10 |
-
|
|
|
11 |
|
12 |
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|
|
|
6 |
test = os.environ.get("test")
|
7 |
endpoint = f"https://api.voicerss.org/?key={test}&src={text}&hl=en-us"
|
8 |
response = requests.get(endpoint)
|
9 |
+
with open("output.mp3", "wb") as f:
|
10 |
+
f.write(response.content)
|
11 |
+
return "output.mp3"
|
12 |
|
13 |
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|