Hello @Ayush_Kumar_Shah, welcome to the forums !
This is a super use case you have here I had a similar usecase where I wanted to record my voice via Streamlit and then make a âchipymunkâ version of it.
I think I remember why I had to put it down for now :
- My initial take was to select the recording audio device through
sounddevice
, or in your case throughpyaudio
, but this selects the recording device on Streamlitâs server, not on the user facing web page. So if your app is deployed, selecting the recording device for the server is not very interesting⊠- My second take would be to use some HTML5 input audio capture, but I think this needs some JS processing, and Streamlit does not support that yet.
- That could be an interesting Custom Component to write.
- If you a super courageous, though this is more of a hack that I have yet to test, you can run ipywidgets in Bokeh 2 so you could try ipywebrtc inside st.bokeh_chart, have the output file streamed in a temporary folder and have Streamlit watch that folderâŠ
- You could cheat the system by pre-recording your guitar play and send it through the file uploader in the meantime (thatâs ultimately what I did when translating the DDSP Colab demo to StreamlitâŠ)
- Did not skim the Streamlit File Uploader source code but maybe itâs possible to enhance it with audio capture capabilities ? There are github issues here and here, we can add our use cases there and see if more people are interested in this feature natively in Streamlit or as a custom component. I would be a big fan for audio/video input in native Streamlit though, because âDeep Learningâ
Hope this helps a bit