start warning only when buffer starts to fill
This commit is contained in:
parent
43a40e2d76
commit
67ee2b4091
1 changed files with 1 additions and 1 deletions
|
@ -979,7 +979,7 @@ pub const Session = struct {
|
||||||
const end_time = std.time.nanoTimestamp();
|
const end_time = std.time.nanoTimestamp();
|
||||||
const processing_ms = @divTrunc(end_time - start_time, std.time.ns_per_ms);
|
const processing_ms = @divTrunc(end_time - start_time, std.time.ns_per_ms);
|
||||||
const realtime_ms = (samples_read * 1000) / 16000;
|
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 });
|
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
|
// Reset error counters after successful operations
|
||||||
|
|
Loading…
Add table
Reference in a new issue