Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import os
|
4 |
+
|
5 |
+
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 |
+
return response.content
|
10 |
+
|
11 |
+
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|