How my CEPA‑based TV volume stabilizer works (AI/ML + Broadlink + local server)
It doesn’t rely on simple volume thresholds.
The app works as an intelligent TV volume stabilizer — it continuously listens to the TV audio through the computer’s microphone and compares it to a user‑defined target level.
The detection uses CEPA, a contextual analysis that reacts more like a human than a raw meter.
It tracks how the sound evolves over time: rise speed, duration, consistency and patterns typical for commercial blocks.
When the system decides the volume is outside the comfort range, it sends a command to a local Flex (Flask) server, which then triggers a Broadlink IR signal to adjust the TV volume.
The reaction is very fast — usually within a fraction of a second — and everything happens automatically without user interaction.
The goal is to keep the perceived loudness stable, whether the scene is quiet, loud or interrupted by ads.
If you want to see how everything works under the hood, the full code and documentation are on the project page.
I’d appreciate any feedback from the community — especially ideas on improving the detection logic or the automation pipeline.