DEV Community

Discussion on: Deepgram x DEV Hackathon Help Thread

Collapse
 
sandy_codes_py profile image
Santhosh (sandy inspires)

Nope, I followed your Flask repo and did that same. But I really want to run that in just Python and not on Flask. I do have limited knowledge on asyncio. Will be learning that soon. I've shared the error and the complete code I'm using the same thread.

Thread Thread
 
tonyasims profile image
Tonya Sims • Edited

Ok, so if I understand correctly you follwed the Flask example in the tutorial but still having some issues? Is the issue still with PyAudio?

Also, is this the error message you received? (I want to make sure this is the correct error):

input_audio = stream_in.read(3200)
await ws.send(input_audio)

DEBUG:websockets.client:< CLOSE 1008 (policy violation) DATA-0000 [11 bytes]

Thread Thread
 
sandy_codes_py profile image
Santhosh (sandy inspires) • Edited

Sorry to misled you!
Actually I wanted to directly send the audio feed using PyAudio to the Deepgram websocket (that's when the above error is occurring).
But I found your Flask tutorial and used that instead which worked in the first go.

The complete code I used can be found here.

Thread Thread
 
tonyasims profile image
Tonya Sims

Oh nice! Good to hear you found a solution with the tutorial 😄.

About asyncio, yea, I totally understand it can be very confusing. It took me awhile to wrap my head around it. How do you plan on learning asyncio? Tutorials? Blog posts? Videos? Something else?

Thread Thread
 
sandy_codes_py profile image
Santhosh (sandy inspires)

Gonna read through this for a while and try some hands-on stuff.
docs.python.org/3/library/asyncio....
I'll try to make a tutorial here once I get a good grasp.

Thread Thread
 
tonyasims profile image
Tonya Sims

Wonderful! Make sure to let me know when it's published so I can read it :)

Thread Thread
 
sandy_codes_py profile image
Santhosh (sandy inspires)

You got it!