File size: 942 Bytes
3c63367 5c573cb 3c63367 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import streamlit as st
from speechtotext import speech_to_text
from t2s import text_to_speech_page
def main():
st.title("Speech n Text Conversion")
# Define a dictionary to map page names to their corresponding functions
pages = {
"Text to Speech": text_to_speech_page,
"Speech to Text": speech_to_text
}
# Display a sidebar for navigation
st.sidebar.title("Navigation")
# Get the selection from the user
selection = st.sidebar.radio("Go to", list(pages.keys()))
# If the user selects "Text to Speech", show the text-to-speech page
if selection == "Text to Speech":
text_to_speech_page()
# If the user selects "Speech to Text", show the speech-to-text page
elif selection == "Speech to Text":
speech_to_text()
# Add additional pages here as needed
# elif selection == "Page Name":
# page_function()
if __name__ == "__main__":
main()
|