SiddhantSadangi / st_deepgram_playground

API playground for Deepgram built with Streamlit

Home Page:https://deepgram-playground.streamlit.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audio stream from microphone

olyaee opened this issue · comments

Hey,

have you tried streaming from microphone? How did it work. Im mainly interested in how to stream the audio chunks to deepgram from microphone.

Thanks,

Hey @olyaee 👋

I haven't tried that tbh. Let me check if it can be done.
It's been a while since I visited this app, and looks like a lot has changed on the Deepgram API's end, so it might take me a while 🙈

Hey @olyaee

I started looking into it, but since the Deepgram docs now support only their V3 SDK, and my app runs on V2, I'll first work on upgrading it to V3.

Meanwhile, if you are interested in giving this a shot, I'd recommend using streamlit-webrtc to collect streaming audio chunks and then pass them over to Deepgram as described in this guide: https://developers.deepgram.com/docs/getting-started-with-the-streaming-test-suite.

If you are able to implement something, I'ld love to work together to add this feature to the updated app with Deepgram SDK v3 :)

Hey @olyaee ,

I've updated the app to support Deepgram SDK v3.

Regarding streaming from a microphone, Deepgram provides an interface to stream input from the microphone: https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/streaming/microphone/main.py

However, this uses PyAudio that does not work with Streamlit: https://discuss.streamlit.io/t/help-with-using-pyaudio/39961

Given that experimenting with streamlit-webrtc will take considerable effort, I am unlikely to start unless this feature gets more requests or someone volunteers to help with a PR.

what about using the Stream sound from browser microphone and proxy it?

@idotr7 - you mean using WebRTC?
You can try using streamlit-webrtc.

i tried it, and it seems the webrtc component is out dated or some other problem.
anyway i tried i failed to make it work

🤔 It seems to be pretty well maintained.
Can you create an issue in their repo (https://github.com/whitphx/streamlit-webrtc/issues) describing your problem?

Hey @olyaee ,

I've updated the app to support Deepgram SDK v3.

Regarding streaming from a microphone, Deepgram provides an interface to stream input from the microphone: https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/streaming/microphone/main.py

However, this uses PyAudio that does not work with Streamlit: https://discuss.streamlit.io/t/help-with-using-pyaudio/39961

Given that experimenting with streamlit-webrtc will take considerable effort, I am unlikely to start unless this feature gets more requests or someone volunteers to help with a PR.

Thank you for the updates, I am currently also packed and am not planning to modify webrtc. After looking into it, It seemed not that straight forward, so I also skipped it