Problem with sound device and/or Google GRPC (.so/CFFI)

8 views
Skip to first unread message

Andrew Francis

unread,
Mar 13, 2023, 2:12:43 PM3/13/23
to Montréal-Python
Hi Montreal Pythonistas:

I am writing a program using the sounddevice library, Python's asyncio library and Google Dialogflow.

I have a task running Dialogflow's detect_streaming_intent(). The task reads from a queue of type asyncio.Queue. In turn, the audio is used by detect_streaming_intent() for natural language processing.

In turn, I have another task, that uses the sounddevice library to continuously read from the mic. This task communicates via a queue of type asyncio.Queue.

I can successfully have the sounddevice task write its output to a file (running in another task).

I  can successfully have a task read from a WAV file and write it to the queue shared by  Dialogflow.

However when I have the sounddevice task talk to the Dialogflow task, I immediately get a CancelledError() with no other information

When I debug, the problem seems to be in the grpc.so file. 

I have two sets of questions. First I need to tell Dialogflow stuff like about the encoding method and the frequency. What else would differ from reading from a mic, and reading from a WAV file?

Second, I could I set up the debugger so I can trace into the grpc.so file. I'll willing to compile my own copy of grpc.

Any suggestions would be appreciated!

Cheers,
Andrew

Reply all
Reply to author
Forward
0 new messages