start warning only when buffer starts to fill

This commit is contained in:
Emil Lerch 2025-10-07 12:53:32 -07:00
parent 43a40e2d76
commit 67ee2b4091
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -979,7 +979,7 @@ pub const Session = struct {
const end_time = std.time.nanoTimestamp();
const processing_ms = @divTrunc(end_time - start_time, std.time.ns_per_ms);
const realtime_ms = (samples_read * 1000) / 16000;
if (processing_ms > realtime_ms)
if (processing_ms > realtime_ms and buffer_fill > 20)
std.log.warn("Vosk processing behind realtime. {d} samples in {d}ms (realtime: {d}ms), buffer {d}% full", .{ samples_read, processing_ms, realtime_ms, buffer_fill });
// Reset error counters after successful operations