File size: 319 Bytes
018b3e1
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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"
    response = requests.get(endpoint)
    return response.content

gr.Interface(text_to_speech, inputs="text", outputs="audio").launch()