Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio stream from microphone #1

Open
olyaee opened this issue Mar 5, 2024 · 8 comments
Open

Audio stream from microphone #1

olyaee opened this issue Mar 5, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@olyaee
Copy link

olyaee commented Mar 5, 2024

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,

@SiddhantSadangi SiddhantSadangi self-assigned this Mar 5, 2024
@SiddhantSadangi
Copy link
Owner

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 🙈

@SiddhantSadangi SiddhantSadangi added enhancement New feature or request question Further information is requested labels Mar 5, 2024
@SiddhantSadangi
Copy link
Owner

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 :)

@SiddhantSadangi SiddhantSadangi added help wanted Extra attention is needed and removed question Further information is requested labels Mar 9, 2024
@SiddhantSadangi
Copy link
Owner

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.

@SiddhantSadangi SiddhantSadangi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
@idotr7
Copy link

idotr7 commented Mar 25, 2024

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

@SiddhantSadangi
Copy link
Owner

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

@idotr7
Copy link

idotr7 commented Mar 25, 2024

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

@SiddhantSadangi
Copy link
Owner

🤔 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?

@olyaee
Copy link
Author

olyaee commented Apr 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants