Closed wladimirleite closed 11 months ago
Things that I tried but did NOT make any difference regarding the described behavior:
After a lot of failed attempts, I finally found out that limiting the reading buffer (e.g. to 64 KB) solved the issue (currently a 1 MB buffer is used). I guess that there is some kind of internal (native) memory buffer used by Vosk, handled by a synchronized piece of code, that somehow was having trouble dealing with large inputs and many threads.
As discussed in #1899, when using Vosk audio transcription in a very large case (with many audio files), @paulobreim noticed that CPU usage fell after some point. I was able to reproduce the issue by processing a large sample (~150K) of audio files.
Later I wrote the small standalone program below, which made it easier to reproduce the problem (using a PC running Windows and 48 logical processors). With this program and the sample audio below, the issue (CPU usage decreases and transcription slows down) is noticeable after a couple of minutes.
The sample audio I used: sample-audio.zip