From b43a1ce17fb83ea76342f3833bb5d0bec8eac8b9 Mon Sep 17 00:00:00 2001 From: Assistant builder Date: Fri, 12 Jun 2026 11:43:28 +0000 Subject: [PATCH] WakewordModel: clean up stale comment, clarify ring-fill boundary case --- tests/02-wakeword-cs/WakewordModel.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/02-wakeword-cs/WakewordModel.cs b/tests/02-wakeword-cs/WakewordModel.cs index 26b2d6b..b40293b 100644 --- a/tests/02-wakeword-cs/WakewordModel.cs +++ b/tests/02-wakeword-cs/WakewordModel.cs @@ -110,7 +110,11 @@ internal sealed class WakewordModel : IDisposable _rawRingFill += copyToFront; if (copyToFront < FrameSamples) { - // Shouldn't happen on the very first call, but defensive. + // Boundary case: ring was partially full and the new frame overshoots + // remaining capacity. Fires exactly once during warm-up (typically call 2, + // when _rawRingFill = 1280 and the incoming 1280 samples overshoot the + // remaining 480 capacity). Shift the older samples left to make room, + // then write the leftover at the tail. int leftover = FrameSamples - copyToFront; Array.Copy(_rawRing, leftover, _rawRing, 0, MelInputSamples - leftover); Array.Copy(frame1280, copyToFront, _rawRing, MelInputSamples - leftover, leftover); @@ -191,8 +195,6 @@ internal sealed class WakewordModel : IDisposable return clsOut[0, 0]; } - // ... methods follow in Step 2 ... - public void Dispose() { _mel.Dispose();