/** * Silence-gap and filler-word detection. * * Built on the same `ffmpeg silencedetect` pattern used by * `.agents/skills/burn-in-subtitles/scripts/derive-captions.ts`. Reused here * rather than duplicated. * * Filler words are identified from word-level transcripts (not audio), so * this module pairs with `src/editing/packer.ts` output. */ import type { WordTiming } from './types.js'; export interface SilenceSpan { startSec: number; endSec: number; durationSec: number; } export interface DetectSilencesOptions { silenceDb?: number; silenceMin?: number; /** Optional time range; if omitted, runs on the whole file. */ startSec?: number; endSec?: number; } /** * Run ffmpeg silencedetect and parse the silence spans. Defaults match the * burn-in-subtitles skill's recommendations for Kokoro-style VO. */ export declare function detectSilences(file: string, options?: DetectSilencesOptions): SilenceSpan[]; /** * Default filler-word lexicon. "you know" and "i mean" are handled as * bigrams via the multi-word detector below. * * Intentionally excluded: * - `...` (three dots) — Kokoro intentional breath gap (anti-pattern E2) * - `so` / `well` / `okay` — too often content-bearing for general removal */ export declare const DEFAULT_FILLER_UNIGRAMS: Set; export declare const DEFAULT_FILLER_BIGRAMS: Array<[string, string]>; export interface FillerMatch { startSec: number; endSec: number; text: string; /** Preferred trim — includes a small padding window so we cut cleanly. */ trimStartSec: number; trimEndSec: number; kind: 'filler-unigram' | 'filler-bigram'; } export interface DetectFillersOptions { unigrams?: Set; bigrams?: Array<[string, string]>; /** Padding around each filler for cleaner trims (seconds). */ paddingSec?: number; /** * Minimum gap between a filler and the next content word for the filler * to be a safe trim candidate. Prevents clipping adjacent content. */ minGapSec?: number; } /** * Scan a word stream for filler words and bigrams, returning trim * candidates with padded boundaries. The caller decides which to apply — * never auto-trim without user confirmation (anti-pattern E2). */ export declare function detectFillers(words: WordTiming[], options?: DetectFillersOptions): FillerMatch[]; export interface CutCandidate { atSec: number; kind: 'silence' | 'sentence-end' | 'phrase-end'; scoreSec: number; } /** * Suggest cut points within a take: silence midpoints, sentence endings, * and phrase endings. Score = estimated time to the next content word * (larger scores are safer cuts). */ export declare function suggestCutCandidates(silences: SilenceSpan[], words: WordTiming[]): CutCandidate[]; //# sourceMappingURL=silence.d.ts.map