dragon-iso/src/TeamsISO.Engine.NdiInterop
Zac Gaetano c53c7a7768
Some checks failed
CI / build-and-test (push) Failing after 29s
Wire engine audio peak metering — UI VU bars now animate
The DataGrid's per-row audio level bar (in the Live column) was inert because IsoHealthStats.PeakAudioLevel always returned 0.0. Engine work needed: capture NDI audio frames, compute peak amplitude, publish through the existing stats path.

Engine:

- AudioPeakComputer (new): max-abs computation across NDI's FLTP / FLT / PCM s16 sample formats. Pure managed code, fully unit-tested (14 cases — clamping behaviour, edge cases like short.MinValue overflow, totalSamples-vs-buffer mismatch defenses).

- INdiInterop.CaptureAudioPeak (new, default-implemented): polls one audio frame, returns peak in [0,1] or null on timeout. FakeNdiInterop inherits the no-op default; production NdiInteropPInvoke overrides with real FLTP decode through a sibling RecvCaptureV3Audio import + RecvFreeAudioV3.

- NdiNative: AudioFrameV3 struct + audio-only RecvCaptureV3 binding + FreeAudioV3.

- NdiReceiver: spins up a sibling audio-capture loop alongside the existing video loop on the same lifetime. Audio failures are caught + logged but never re-thrown (a misbehaving audio path must never tear down the live video pipeline). Latest peak published via Volatile<long> (BitConverter int64 bits) so UI reads are torn-free across threads.

- IsoPipeline.GetStats: surfaces NdiReceiver.LatestAudioPeak as IsoHealthStats.PeakAudioLevel.

UI:

- ParticipantViewModel.OnStatsTick already had the decay logic (max-of-new-or-decayed-old, 0.7 multiplier) waiting for real values. No UI changes needed.

Tests: 14 new + 141 existing = 155/155 passing. 0 warnings, 0 errors.
2026-05-10 13:28:26 -04:00
..
NdiInteropPInvoke.cs Wire engine audio peak metering — UI VU bars now animate 2026-05-10 13:28:26 -04:00
NdiNative.cs Wire engine audio peak metering — UI VU bars now animate 2026-05-10 13:28:26 -04:00
NdiNativeLibraryResolver.cs fix(ndi): resolve Processing.NDI.Lib.x64 via NDI_RUNTIME_DIR_V6 env var 2026-05-07 15:14:54 -04:00
NdiPInvokeHandles.cs feat(interop): add NDI 6 native bindings, handle types, and version constants 2026-05-07 15:34:54 +00:00
NdiVersion.cs fix(ndi): match the NDI 6 WIN64 runtime banner in version probe 2026-05-07 15:15:03 -04:00
Placeholder.cs feat(interop): scaffold TeamsISO.Engine.NdiInterop project 2026-05-07 15:08:21 +00:00
TeamsISO.Engine.NdiInterop.csproj feat(interop): scaffold TeamsISO.Engine.NdiInterop project 2026-05-07 15:08:21 +00:00