File size: 336 Bytes
474f4cc
cc84c76
 
474f4cc
 
 
cc84c76
e2bb816
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import streamlit as st
from gtts import gTTS 
from io import BytesIO

x = st.slider('Select a value')
st.write(x, 'squared is', x * x)

prompt = st.chat_input("Say something")
if prompt:
    sound_file = BytesIO()
    tts = gTTS('Add text-to-speech to your app', lang='en')
    tts.write_to_fp(sound_file)
    
    st.audio(sound_file)