Skip to content

Add offline plan_segments() seam for batch transcription - #49

Open
sumgup0 wants to merge 2 commits into
paulbrav:masterfrom
sumgup0:meet-seams
Open

Add offline plan_segments() seam for batch transcription#49
sumgup0 wants to merge 2 commits into
paulbrav:masterfrom
sumgup0:meet-seams

Conversation

@sumgup0

@sumgup0 sumgup0 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Exposes TransClip's silence-cut policy as a pure, offline plan_segments(pcm16, *, sample_rate, max_segment_s) so a downstream meeting recorder can reuse it. Returns contiguous, non-empty PlannedSegment intervals that partition the whole input; cuts at the latest qualifying silence per window (reusing the live commit-cut logic) and forces a cut at the quietest frame in the window's final FORCED_CUT_WINDOW_S when far-end speech never pauses. No segment exceeds max_segment_s.

Dictation path unchanged. Commit 1 is a pure, behavior-preserving extraction: _frame_dbfs/_silence_threshold are pulled out of _find_commit_cut with byte-identical arithmetic; its signature and its live caller are untouched. Commit 2 adds the offline planner and its tests. The planner lives in asr_incremental.py (not a new module) so it can reuse those private commit-cut helpers.

Evidence: full suite 461 passed / 5 skipped; test_asr_incremental 31/31 incl. 10 PlanSegmentsTests; ruff check clean; compileall clean. (Note: ruff format --check flags a pre-existing line in _worker_loop unrelated to this diff.)

Two commits, each independently reviewable: the behavior-preserving refactor, then the new feature.

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.

1 participant