Skip to content

Fix Gradio audio clipping for empty selections and AI timestamps - #248

Open
LauraGPT wants to merge 1 commit into
mainfrom
codex/gradio-audio-selection
Open

LauraGPT wants to merge 1 commit into
mainfrom
codex/gradio-audio-selection

Conversation

@LauraGPT

@LauraGPT LauraGPT commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

On audio uploads, a manual selection with no match offered the entire recording as the clipped result. Both AI clipping buttons also passed a video-only keyword to the audio clipper; dropping it alone would still use milliseconds as sample indices.

Use the existing strict audio-selection contract in the Gradio callbacks, clear both media and SRT on an empty result, and convert AI time ranges into sample indices at the normalized audio rate. Video calls and the public Python clipper default are unchanged.

Tested with actual Chromium, Gradio and a generated three-second, three-tone WAV. The baseline returned all 48,000 samples on a miss. Manual and both AI buttons now select samples 16,000 through 33,599 (including the default 100 ms tail); the returned waveforms match the source interval. A subsequent miss clears the result in all three flows. Recognition used fixed tokens/timestamps; AI ranges were typed into the UI, with no model, microphone or provider call.

Shanghai CPU suite: 142 passed, one credential-dependent integration skipped. Adds regression cases to the existing hosted Gradio job.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
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