alphacep / vosk-server

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

Silence in recording throws error on server #128

Closed PWAlessi closed 3 years ago

PWAlessi commented 3 years ago

I am transcribing a long phone call using the grpc streaming API and the alphacep/kaldi-grpc-en:latest docker container. I have it working great and I am really enjoying using the software.

My problem is that when there is a long pause in speaking on the phone call, the server throws:

ERROR:grpc._server:Exception iterating responses: division by zero
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/grpc/_server.py", line 462, in _take_response_from_response_iterator
    return next(response_iterator), True
  File "./stt_server.py", line 83, in StreamingRecognize
    yield self.get_response(recognizer.Result())
  File "./stt_server.py", line 71, in get_response
    alt_conf = sum(confs) / len(confs)
ZeroDivisionError: division by zero

Is it possible to configure the server to be tolerant of silence?

nshmyrev commented 3 years ago

We should have fixed this error and updated the images too. Please check.

PWAlessi commented 3 years ago

Confirmed, it's fixed. Thanks!