Oreos2 / app.py
AdrianLambdaVerde's picture
Update app.py
cabf3df
raw
history blame
829 Bytes
import streamlit as st
from audiorecorder import audiorecorder
st.markdown("<h1 style='text-align: center;'>Tell us how you feel</h1>", unsafe_allow_html=True)
st.write("<h3 style='text-align: center; color: lightSeaGreen;'>we'll generate the insights</h3>", unsafe_allow_html=True)
# Create a speech_recorder component.
speech_recorder = hf.spaces.component("speech_recorder", language="en", sampling_rate=16000)
# Add a button to the app that allows users to start and stop recording.
button = st.button("Record speech")
# When the user clicks the button, start recording the user's speech.
if button.clicked:
speech_recorder.start()
# When the user stops recording, return a transcript of the user's speech.
if speech_recorder.is_finished:
transcript = speech_recorder.get_transcript()
st.write(transcript)