alphacep / vosk-server

WebSocket, gRPC and WebRTC speech recognition server based on Vosk and Kaldi libraries
Apache License 2.0
902 stars 243 forks source link

Sometimes blocking about test_microphone.py #255

Open YunzhaoLu opened 3 months ago

YunzhaoLu commented 3 months ago

Using this python script to test microphone connecting to websocket server. https://github.com/alphacep/vosk-server/blob/master/websocket/test_microphone.py
There is blocking (as following) if server side doesn't return response at each data chunk.
while True:
data = await audio_queue.get()
await websocket.send(data)
print (await websocket.recv()) # blocking here waiting for message.

It happened when VAD is applied at server side and no response if data chunk is silent.

nshmyrev commented 2 months ago

Sorry, we do not have VAD. Probably you don't have enough memory on the server and it goes to swap. Try to increase memory.

YunzhaoLu commented 2 months ago

image

It should not relate to memory. Please see this flow. Server drop the silent chunks, and client waits for response, and never send the next chunk. Thank you.

nshmyrev commented 2 months ago

We do not have VAD in our server, it is probably your custom modification.