Samples should be an integer, not seconds

- Merge pull request #49 from skripnik/patch-1
- tested performance --  ESIC dev2, 27 docs, on En, De, Cs ASR, Nvidia A40, min chunk 1s, VAD => it has lower WER and latency with "segment" buffer trimming with various thresholds
This commit is contained in:
Dominik Macháček 2024-01-03 10:37:32 +01:00 committed by GitHub
commit bfbe83d792

View file

@ -355,7 +355,7 @@ class OnlineASRProcessor:
""" """
self.transcript_buffer.pop_commited(time) self.transcript_buffer.pop_commited(time)
cut_seconds = time - self.buffer_time_offset cut_seconds = time - self.buffer_time_offset
self.audio_buffer = self.audio_buffer[int(cut_seconds)*self.SAMPLING_RATE:] self.audio_buffer = self.audio_buffer[int(cut_seconds*self.SAMPLING_RATE):]
self.buffer_time_offset = time self.buffer_time_offset = time
self.last_chunked_at = time self.last_chunked_at = time