Skip to content

Honor start_frame for single-chunk audio selections - #131

Open
antonsoo wants to merge 1 commit into
timsainb:masterfrom
antonsoo:fix/single-chunk-start
Open

antonsoo wants to merge 1 commit into
timsainb:masterfrom
antonsoo:fix/single-chunk-start

Conversation

@antonsoo

Copy link
Copy Markdown

get_traces(start_frame=1000, end_frame=3000) returns 3,000 samples instead of the requested 2,000 whenever the interval fits in one chunk. The fallback passes a hardcoded zero to filter_chunk, so it also starts at the wrong audio position.

Forward the requested start_frame. Regressions compare selected samples with the original waveform when noise reduction is disabled, covering mono/stereo audio, disabled chunking, exact chunk lengths and intervals spanning multiple chunks.

On the bundled recording, this corrects 56 wrong selections across NumPy stationary/nonstationary and Torch CPU/CUDA workflows. All 40 unaffected selection controls are byte-identical.

Ten new regressions fail before the fix; all 18 pass afterward. The complete suite passes 24 tests. New-test lint passes; package lint retains the same 94 existing findings. Tested on Linux/Python 3.12; this change does not alter the filtering algorithm.

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