Skip to content

feat(pipelines): clean up only low quality recordings, a quality gate on clean_audio - #623

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-hnzflg
Oct 18, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-hnzflg

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Description

Before: the clean_audio step (#569) cleaned every recording it ran on, so a pipeline carrying the step also ran WebRTC processing over recordings that already sounded fine.

After: the step can measure each recording's signal-to-noise and clipping first and leave a clean-sounding one exactly as it is, cleaning only the noisy, quiet or clipped ones. A pipeline can now carry clean_audio for everything while only the recordings that need it are actually touched; a good recording is transcribed from its original. This is off by default, so the step's existing behaviour (clean everything) is unchanged.

Turn on "Clean only low quality recordings" under Settings → Transcription → Audio cleanup and set the signal-to-noise floor (default 20 dB). The measurement is numpy only, no model: noise floor and speech level from two percentiles of the 10 ms frames, plus a clipping check. What it measured (snr_db, clip_pct) is kept on the recording in GET /api/v1/recordings/{id}, and a skipped recording keeps no other cleanup options.

Motivation and Context

Follow-up on top of #569. This thread's ask was to detect low quality audio and only then enhance it; #569 shipped the cleanup itself, and this adds the quality gate on top rather than a parallel step. A doubtful recording (SNR that can't be judged, or clipping) is still cleaned, so the gate never skips something that needs help.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I added a changelog.d/ fragment.

Done questions (AGENTS.md)

  • Goal: a pipeline can carry clean_audio yet clean only low quality recordings; delivered end to end.
  • Agents: the gate is part of the clean_audio step, reachable through the API, MCP and automations exactly as the step is; snr_db/clip_pct are in the recording's API response.
  • Zero setup: no new prerequisite; the measurement is numpy, which is already present.
  • Fewest clicks: one toggle, with the floor shown only when it's on.
  • Configurable: transcribe.cleanup.only_if_poor and snr_floor_db in Settings → Transcription → Audio cleanup, with defaults, out of the wizard.
  • Light: no new dependency; the measurement is a fraction of a second.
  • Private and secure: n/a, no new data leaves the box and no new attack surface (reuses the step's file handling).
  • Cost: the gate reads the audio locally and can save cleanup work; no model call.
  • User decides: off by default, the step's clean-everything behaviour unchanged.
  • Upgrades: new optional keys default to the old behaviour; no stored-data shape change.
  • Honest: docs and the changelog say it's off by default and what it measures.
  • Tests, docs and generated files updated (test_audio_cleanup.py, docs/processing.md, make openapi).
  • Open standards; no new dependency, Lens stays MIT.
  • Result reported with evidence; tests green locally.
  • Reuse: extends clean_audio and its settings rather than adding a second cleanup step.

Generated by Claude Code

@adeelahmad
adeelahmad merged commit eab80ac into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-hnzflg branch October 18, 2026 15:13
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.

2 participants