Auto Remove Silence: on-device silence detection, removal UI, and MCP tool#175
Open
ofcskn wants to merge 7 commits into
Open
Auto Remove Silence: on-device silence detection, removal UI, and MCP tool#175ofcskn wants to merge 7 commits into
ofcskn wants to merge 7 commits into
Conversation
- Add English canonical doc at docs/remove-silence.md covering desktop workflow, parameters, linked clips, MCP tool reference, and tips - Add 13 translated versions (es, zh-CN, zh-TW, ja, ko, vi, hi, bn, ar, it, pt-BR, fr, ru) each with AI disclaimer and language nav - Add smoothCuts flag to SilenceConfig (default true) — applies a 2-frame fadeInFrames to every new clip fragment after silence removal, softening hard cut edges through the existing volume ramp pipeline - Expose smooth cuts toggle in SilenceRemovalSheet - Consolidate undo management: removeSilences now owns its own undo group so the ripple and fade are undone together with a single ⌘Z
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.
Closes #174
Summary
Adds Auto Remove Silence — detect silent regions in a clip and ripple-delete them, closing the gaps. Detection runs fully on-device from the clip's RMS audio envelope; no AI/transcription dependency. Also exposes the capability to AI agents over MCP.
What's included
SilenceDetector— pure logic: walksAudioEnvelopeRMS samples into source-second silence ranges (threshold, minimum duration, edge padding), then maps them to projectFrameRanges honoring clip offset, trim, and speed. Out-of-bounds ranges are dropped.EditorViewModel+SilenceRemoval— async bridge that extracts the envelope, detects silences, and feeds ranges to the existingrippleDeleteRangesOnTrackengine (linked A/V partners and sync-locked tracks ripple along; fully undoable).SilenceRemovalSheet— SwiftUI sheet with threshold (dB), min duration, edge-padding sliders, and a smooth-cuts toggle, plus a live detected-count preview before committing. Styled entirely viaAppTheme.waveform.badge.minus) — enabled when a single audio/video clip or a linked A/V pair is selected.remove_silenceMCP/agent tool — lets an AI model remove silence on a named clip via MCP (clipId, optionalthresholdDb/minSilenceDuration/edgePadding). Auto-registered throughToolDefinitions.all.SilenceConfig.smoothCuts(defaulttrue) applies a 2-framefadeInFramesto each new clip fragment, softening hard cut edges through the existing volume-ramp pipeline. Ripple and fade are grouped into one undoable action.docs/remove-silence.md(English) + 13 translations (es, zh-CN, zh-TW, ja, ko, vi, hi, bn, ar, it, pt-BR, fr, ru).Bug fixes
silenceRemovalCandidatenow accepts multiple selected clips when they all share onelinkGroupId, preferring the audio clip as the detection source.rippleDeleteRangesOnTrackengine already cuts all clips in alinkGroupIdtogether; no extra code needed.Testing
SilenceDetectorTests(8),SilenceRemovalViewModelTests(8),RemoveSilenceTests(7).swift buildclean.Notes
Detection is threshold-based on the RMS envelope (10 ms hops at 16 kHz) — the same envelope infrastructure already used for waveforms and audio sync.