Streamlit component that allows to convert text to speech and play it directly in the browser
Project description
streamlit-custom-component
Streamlit component that allows you to convert text to speech and autoplay the audio directly.
Installation instructions
pip install streamlit-TTS
Usage instructions
import streamlit as st
#from streamlit_TTS import auto_play, text_to_speech, text_to_audio
from gtts.lang import tts_langs
langs=tts_langs().keys()
audio=text_to_audio("Choose a language, type some text, and click 'Speak it out!'.",language='en')
auto_play(audio['bytes'])
lang=st.selectbox("Choose a language",options=langs)
text=st.text_input("Choose a text to speak out:")
speak=st.button("Speak it out!")
if lang and text and speak:
text_to_speech(text=text, language=lang)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit_TTS-0.0.1.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_TTS-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dad29cc3de545693db4b2c0bd8f60a33fc395d74625cebf9f6320ac1bebf235 |
|
MD5 | f521fd22d5491376c9e5e77e4682fad4 |
|
BLAKE2b-256 | e777c427b575083da4036ae07c98f5a41d17d020db40454918af0fa42bb75353 |