Open emphasize opened 10 months ago
There are different issues leading to this raise, but ultimately the loop is not capable to fill the queue - self.chunk_size=4096[bytes]
- in timeout
(default=5 seconds)
Above issue is get
ting negative size microphone chunks, but mathematically it would only require 4096 / 5 - 1
bytes sized chunks/sec to raise
(what likely happened in other cases without warning logs about the size)
full_chunk += mic_chunk
while len(full_chunk) >= self.chunk_size:
self._queue.put_nowait(full_chunk[: self.chunk_size])
full_chunk = full_chunk[self.chunk_size:]
time.sleep(0.0)
(What is this 0.0 wait about? check period size <=> chunk size)
Reported in Chat by @goldyfruit
just check for
self._queue.qsize()
in advance