Skip to content

Harden native Auto Gain filter - #47

Merged
alnitak merged 3 commits into
alnitak:mainfrom
Avejack:fix/harden-native-autogain
Jul 5, 2026
Merged

Harden native Auto Gain filter#47
alnitak merged 3 commits into
alnitak:mainfrom
Avejack:fix/harden-native-autogain

Conversation

@Avejack

@Avejack Avejack commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #46

Summary

  • replace the capture Auto Gain implementation with a stateful AGC using frame-count/sample-rate based smoothing
  • add noise-floor gating, headroom limiting, PCM-safe sample writes, and read-only AGC telemetry
  • expose the new Auto Gain parameters and metrics through the Dart filter API
  • add Dart metadata tests and an offline C++ fixture for callback-size invariance, silence handling, limiting, s16 full-scale safety, and read-only metrics
  • regenerate web WASM artifacts and update the Android example build tooling in separate commits

Testing

  • dart analyze
  • flutter test --no-pub test
  • g++ -std=c++17 -Wall -Wextra -Wpedantic -I src test/cpp/autogain_test.cpp src/filters/autogain.cpp -o /tmp/flutter_recorder_autogain_test && /tmp/flutter_recorder_autogain_test
  • cmake --build /tmp/flutter_recorder_cmake_build
  • cd web && sh ./compile_wasm.sh using emsdk at /home/Sean/projects/emsdk
  • git diff --check

Notes

  • The first six Auto Gain parameter indices remain in the same order; the new parameters and metrics are additive.
  • Runtime metrics are read-only through the existing filter parameter lookup path.

@alnitak

alnitak commented Jul 5, 2026

Copy link
Copy Markdown
Owner

This is gorgeous PR @Avejack!

Thank you very much!

LGTM, merging and updating on pub.dev.

@alnitak
alnitak merged commit 11a66c4 into alnitak:main Jul 5, 2026
1 check passed
@Avejack
Avejack deleted the fix/harden-native-autogain branch July 9, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden native Auto Gain filter for production recording

2 participants