import streamlit as st | |
import requests | |
API_URL="http://localhost:8000/audios/record" | |
st.title("Speech To Text Testing ") | |
st.write("Click 'Start Recording' to capture and transcribe speech.") | |
if st.button("Start Recording"): | |
with st.spinner("Recording... Speak now."): | |
response = requests.get(API_URL) | |
if response.status_code == 200: | |
st.success("Recording complete!") | |
st.write("### Transcription:") | |
st.write(response.json()["transcription"]) | |
else: | |
st.error("Error recording audio") | |