Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This pull request introduces a new feature that allows users to set the duration for meditation in seconds. The application now prompts users to input their desired meditation duration, which is then displayed in the app. #207

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions serenifi_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import streamlit as st
import pyttsx3

# Initialize session state
if 'meditation_duration' not in st.session_state:
st.session_state.meditation_duration = 0

def speak(text):
"""Function to perform text-to-speech."""
engine = pyttsx3.init()
engine.say(text)
engine.runAndWait()

# Streamlit app title and introduction
st.title("Serenifi App")
st.write("Welcome to the Serenity Guide!")

# Input for meditation duration
st.session_state.meditation_duration = st.number_input("Set meditation duration (seconds):", min_value=0, value=0)

# Button to start meditation
if st.button("Start Meditation"):
# Speak out the meditation duration
speak(f"Starting meditation for {st.session_state.meditation_duration} seconds.")
# Add your meditation timer logic here (if needed)

# Display the current meditation duration
st.write("Duration: {} seconds".format(st.session_state.meditation_duration))