Spaces:
Sleeping
Sleeping
import streamlit as st | |
from audio_recorder_streamlit import audio_recorder | |
import time | |
def show_live_session(): | |
st.title("Live Session Recording") | |
# Session setup | |
if "recording" not in st.session_state: | |
st.session_state.recording = False | |
# Recording controls | |
col1, col2 = st.columns(2) | |
with col1: | |
if st.button("Start Recording"): | |
st.session_state.recording = True | |
with col2: | |
if st.button("Stop Recording"): | |
st.session_state.recording = False | |
# Recording interface | |
if st.session_state.recording: | |
audio_bytes = audio_recorder() | |
if audio_bytes: | |
st.audio(audio_bytes, format="audio/wav") | |
# Save recording | |
timestamp = time.strftime("%Y%m%d-%H%M%S") | |
filename = f"session_{timestamp}.wav" | |
with open(filename, "wb") as f: | |
f.write(audio_bytes) | |
# Process recording | |
analyze_session(audio_bytes) | |
def analyze_session(audio_bytes): | |
# Add your session analysis logic here | |
st.write("Processing session...") | |
# Implement real-time analysis using your MI prompts | |