Hey @Jaiharish-passion07,
In Streamlit, any Python code is going to be run server-side, which means when you are using device_index = pa.get_default_input_device()
, it is going to try and get the audio device from the service in the Cloud instead of the device from your browser.
You need to implement code to read audio from the client-side and send it to the Python part for your purpose, which translates in writing JS code…One would normally build a dedicated Streamlit Component for this, integrating for example React-Mic. You may also be able to workaround this using the streamlit-bokeh-events package to pass JS code and interact with the MediaRecorder API as in this example:
All things aside, a Streamlit Audio recorder is a popular demand so if you or anyone can come to a first solution it would be awesomlit’
Fanilo