File size: 914 Bytes
764d7db f2f99fc 764d7db 646cec2 764d7db 287b16c 764d7db 287b16c 764d7db 287b16c 646cec2 764d7db 287b16c |
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 |
import sys
sys.path.append("src")
from agent import AccentAgent
import streamlit as st
st.set_page_config(page_title="AI Accent Agent", layout="centered")
st.title("π§ AI Agent: Accent Classifier")
st.markdown("Upload your voice recording and let the AI detect your accent!")
uploaded_file = st.file_uploader("π€ Upload audio file", type=["wav", "mp3", "m4a"])
if uploaded_file is not None:
with open("temp_audio.wav", "wb") as f:
f.write(uploaded_file.read())
agent = AccentAgent(audio_path="temp_audio.wav")
with st.spinner("Analyzing audio..."):
try:
result = agent.run()
st.audio(result["audio_path"], format="audio/wav")
st.success(f"π― **Detected Accent:** {result['accent']}")
st.markdown(f"π **Transcribed Text:** {result['transcription']}")
except Exception as e:
st.error(f"β Error: {e}")
|