import streamlit as st
#from audiorecorder import audiorecorder
import huggingface_hub as hf
st.markdown("
Tell us how you feel
", unsafe_allow_html=True)
st.write("we'll generate the insights
", 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)