Closed BRIDGE-AI closed 5 years ago
Socket.IO works with event handlers, it does not have a blocking recv function. You are sending your data in the asr-recognize
event, so you need to add a handler for that event in your server. This handler will be invoked every time data arrives.
@miguelgrinberg
I'm integrating google speech api on my flask-socketio server. This implementation is based on flask-socketio and gunicorn with gevent-websocket. I reduced transport method only to websocket on client side socket.io.js.
And it emits microphone audio stream as binary data every 4KB.
I have a sample project for it in java version below.
https://codelabs.developers.google.com/codelabs/speaking-with-a-webpage/#0
And I found similar server-side code for python version below.
https://gist.github.com/cobookman/6459f0423d56527ad136999e57d181ea#file-server-py-L154
Here is my question. Now I think I need a method like
websocket.recv()
on flask-socketio. (on line 154) Is it supported or possible now? Does flask-socketio or python-socketio have it?Or how can I conquer this problem? Do you have any idea?
I need your help again, like always. Thank you, miguel.