Continued Live Transcription of Audio in Python #24
-
I've been using Deepgram's Python SDK to transcribe audio. I want a constant stream of transcription to be put through from Python, but it appears that the SDK doesn't really prompt with responses until you await finish. I'm using pyaudio to listen to my input device, sending chunks of data as they get generated. The callbacks aren't triggered until I stop sending data and send the empty websocket message. Is there a way to constantly send data in Python without needing to signal a stop periodically in order to get transcripts? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 20 replies
-
Hi @sadmoody ! Thank you for your question, and we appreciate you! I'm Tonya, the Python Developer Advocate at Deepgram. To make sure I understand your question, are you asking if there's a way to continually receive data in python without terminating or stopping the program to get the transcripts? |
Beta Was this translation helpful? Give feedback.
-
Hi @sadmoody ! Thank you for your patience. I grabbed a code snippet from one of my colleagues here at Deepgram. Hitting they API directly, they were able to get live streaming working. I'm going to attached the python file |
Beta Was this translation helpful? Give feedback.
Hi @sadmoody ! Thank you for your patience. I grabbed a code snippet from one of my colleagues here at Deepgram. Hitting they API directly, they were able to get live streaming working. I'm going to attached the python file
pyaudio-streaming
and therequirements.txt
file below. I'm playing around with this code to figure out if I can adapt it to the Python SDK. Can you let me know if you were able to run the code sample?requirements.txt
pyaudio-streaming.txt