stefanrmmr / streamlit-audio-recorder

Record Audio from the User's Microphone in Apps that are Deployed to the Web. (via Browser Media-API, REACT-based, Streamlit Custom Component)
MIT License
412 stars 74 forks source link

Start recording automatically when the function is executed. #5

Closed creeksflowing closed 1 year ago

creeksflowing commented 2 years ago

Hi! As far as you know, would it be possible to make the audio recording execute automatically when the function is called, so that the user does not have to press the "Start Recording" button to start the recording? I need the to play and record a file simultaneously, but given that I cannot easily execute the python playback function when the user presses the HTML "Start Recording", I was wondering if it is possible to do this workaround. And another question: is it possible to record at a different sample rate and bit depth? Thank you!

stefanrmmr commented 1 year ago

Hi @creeksflowing, as far as I am concerned the bitrate and sample rate are defined by the browser's environment/setting/your system's audio preferences etc. I am currently not aware of any options to force the browser media settings into specific formats. Regarding recording and playing simultaneously, you could check out @whitphx real-time streaming component https://github.com/whitphx/streamlit-webrtc