Text2Speech / app.py
Pranav4datasc's picture
Upload 2 files
5df35e3 verified
Raw
History Blame Contribute Delete
679 Bytes
import streamlit as st
import requests
import base64
st.title("Text to Speech App - powered by Gradio, hosted on 🤗")
inp_text = st.text_input("Input text here to convert to speech")
button = st.button("⌨️Text to speech magic 🗣️")
if button:
with st.spinner():
response_json = requests.post("https://abidlabs-speak.hf.space/run/predict",json={
"data": [
inp_text,
]}).json()
md = f"""
<audio controls>
<source src="{response_json['data'][0]}" type="audio/flac">
</audio>
"""
st.markdown(
md,
unsafe_allow_html=True,
)