Add offline plan_segments() seam for batch transcription - #49
Open
sumgup0 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-emptyPlannedSegmentintervals 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 finalFORCED_CUT_WINDOW_Swhen far-end speech never pauses. No segment exceedsmax_segment_s.Dictation path unchanged. Commit 1 is a pure, behavior-preserving extraction:
_frame_dbfs/_silence_thresholdare pulled out of_find_commit_cutwith byte-identical arithmetic; its signature and its live caller are untouched. Commit 2 adds the offline planner and its tests. The planner lives inasr_incremental.py(not a new module) so it can reuse those private commit-cut helpers.Evidence: full suite 461 passed / 5 skipped;
test_asr_incremental31/31 incl. 10PlanSegmentsTests;ruff checkclean;compileallclean. (Note:ruff format --checkflags a pre-existing line in_worker_loopunrelated to this diff.)Two commits, each independently reviewable: the behavior-preserving refactor, then the new feature.