Spaces:
Sleeping
Sleeping
File size: 396 Bytes
018b3e1 cf6433f 018b3e1 67b57f5 e8552bd 018b3e1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import gradio as gr
import requests
import os
def text_to_speech(text):
test = os.environ.get("test")
endpoint = f"https://api.voicerss.org/?key={test}&src={text}&hl=en-us&v=Mike"
response = requests.get(endpoint)
with open("output.mp3", "wb") as f:
f.write(response.content)
return "output.mp3"
gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()
|