diff --git a/python/vosk/transcriber/transcriber.py b/python/vosk/transcriber/transcriber.py index 8dd048f4..7b6ac0b3 100644 --- a/python/vosk/transcriber/transcriber.py +++ b/python/vosk/transcriber/transcriber.py @@ -179,7 +179,8 @@ def pool_worker(self, inputdata): fh.write(processed_result) else: print(processed_result) - + if tot_samples == 0: + raise ValueError("Value of total samples is 0. Please check if input is an audio and try again") elapsed = timer() - start_time logging.info("Execution time: {:.3f} sec; "\ "xRT {:.3f}".format(elapsed, float(elapsed) * (2 * SAMPLE_RATE) / tot_samples))