{"_id":"@audio/denoise-desilence","_rev":"2-3d237d873fba8afbecfb45c23d433f88","name":"@audio/denoise-desilence","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@audio/denoise-desilence","version":"0.1.0","keywords":["audio","dsp","denoise","restoration","desilence","vad","silence-removal","smart-speed"],"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","_id":"@audio/denoise-desilence@0.1.0","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"homepage":"https://github.com/audiojs/denoise/tree/main/packages/denoise-desilence","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"67b0fafd232745ed699ae571d241d87f0a496f45","tarball":"https://registry.npmjs.org/@audio/denoise-desilence/-/denoise-desilence-0.1.0.tgz","fileCount":6,"integrity":"sha512-hQAE0XEZz6RGJwMAvDeYtSz7Mv+8n7CbOjh04W5JqOkrhtq4FPuuOD7418IqBLKXU6dYLrsfJ/yAa7JaMlukog==","signatures":[{"sig":"MEUCIGNA+ca6sSX/ICklDnWsmu0lwsZl0XOAClIefTzU9NiXAiEAkrFYU5kKKFMRvqKxBeHbexykEK15hEEixYDwdkNtqCA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20616},"main":"desilence.js","type":"module","audio":"./audio.js","types":"index.d.ts","engines":{"node":">=18"},"exports":{".":"./desilence.js","./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"dce2a64c320ecd1e0923e58041fc5fff23394f1e","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/denoise-desilence"},"_npmVersion":"11.12.1","description":"De-silence — VAD-driven silence handling for speech: remove, shorten (Smart Speed), split, trim","directories":{},"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/vad":"^1.0.0","@audio/stft":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/denoise-desilence_0.1.0_1787959366449_0.3660939349514254","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@audio/denoise-desilence@0.1.1","bugs":{"url":"https://github.com/audiojs/denoise/issues"},"dist":{"shasum":"e0580a56a57944d4549d6ca8f87bf3da288d5f84","tarball":"https://registry.npmjs.org/@audio/denoise-desilence/-/denoise-desilence-0.1.1.tgz","fileCount":6,"integrity":"sha512-6PrSlDFnbPFCTsmXDg7MDA+XGC01rmgTPe40VZsjMGoYv4oQwITtxB9p5WUdiqZsJ5G+o2PvMyig+BSROMZwVw==","signatures":[{"sig":"MEUCIBOpWdfnVP5raKCNS5mg/BVJz8HzhqC0CnLtqZLtrwrPAiEAhNJnTxnVoAL+P3mQX4GQ5iidKsioKd+7BoW0/aezhXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXD3eqGZSYLbSmPiLgXEOEOD5sdtSGa8N3UHY3GUjMNgIhAIrbczeu0xcmKCrsQLggsPt7O6VFf9vDdrzsgzjG7pwC"}],"unpackedSize":20719},"main":"desilence.js","name":"@audio/denoise-desilence","type":"module","audio":"./audio.js","types":"index.d.ts","author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"engines":{"node":">=18"},"exports":{".":{"types":"./index.d.ts","default":"./desilence.js"},"./audio":{"types":"./audio.d.ts","default":"./audio.js"},"./package.json":"./package.json"},"funding":"https://github.com/sponsors/audiojs","gitHead":"5ba1e35a0159d1bedf3e8c426ca982077990c29b","license":"MIT","scripts":{"test":"node test.js"},"version":"0.1.1","_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"homepage":"https://github.com/audiojs/denoise/tree/main/packages/denoise-desilence","keywords":["audio","dsp","denoise","restoration","desilence","vad","silence-removal","smart-speed"],"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/denoise-desilence"},"_npmVersion":"11.12.1","description":"De-silence — VAD-driven silence handling for speech: remove, shorten (Smart Speed), split, trim","directories":{},"maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"sideEffects":false,"_nodeVersion":"25.9.0","dependencies":{"@audio/vad":"^1.0.0","@audio/stft":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/denoise-desilence_0.1.1_1790657202466_0.3544115842494453"}}},"time":{"created":"2026-08-28T23:22:46.293Z","modified":"2026-09-29T04:46:42.801Z","0.1.0":"2026-08-28T23:22:46.593Z","0.1.1":"2026-09-29T04:46:42.547Z"},"bugs":{"url":"https://github.com/audiojs/denoise/issues"},"author":{"name":"Dmitry Iv.","email":"dfcreative@gmail.com"},"license":"MIT","homepage":"https://github.com/audiojs/denoise/tree/main/packages/denoise-desilence","keywords":["audio","dsp","denoise","restoration","desilence","vad","silence-removal","smart-speed"],"repository":{"url":"git+https://github.com/audiojs/denoise.git","type":"git","directory":"packages/denoise-desilence"},"description":"De-silence — VAD-driven silence handling for speech: remove, shorten (Smart Speed), split, trim","maintainers":[{"name":"jamen","email":"jamenmarz@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"readme":"# @audio/denoise-desilence [![npm](https://img.shields.io/npm/v/@audio/denoise-desilence)](https://www.npmjs.com/package/@audio/denoise-desilence) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)\n\nVAD-driven silence handling for speech: remove, shorten (Smart Speed), split, trim\n\n```\nnpm install @audio/denoise-desilence\n```\n\n```js\nimport desilence, { segments, split, project } from '@audio/denoise-desilence'\n```\n\nRuns [`@audio/vad`](https://github.com/audiojs/denoise/tree/main/packages/vad)'s frame-level speech/non-speech decision once over the mono mix, folds it into time segments (bridging gaps shorter than `merge`), then edits the *silence* between and around speech. Three modes: `remove` cuts every pause longer than `minSilence` down to a `pad`-second buffer on each side; `shorten` compresses any pause longer than `maxSilence` to that target, trimmed from the middle so the natural onset/offset survives — the technique behind Overcast's \"Smart Speed\" (Marco Arment, [2015](https://overcast.fm/podcaster/2015/09/09/smart-speed)); `trim` only strips leading/trailing silence. Every cut is an equal-power crossfade, never a hard splice, so the result is click-free at any pause length.\n\n```js\nlet out = desilence(recording, { mode: 'shorten', fs: 44100 })\n// out.data:     Float32Array (or Float32Array[] for multi-channel), same shape as input\n// out.segments: [{ start, end }] — kept regions, input seconds\n// out.removed:  seconds cut\n// out.map:      input→output time breakpoints, read with project(map, t)\n\nlet { speech, silence } = segments(recording, { fs: 44100 })   // analysis only, no editing\n\nlet clips = split(recording, { fs: 44100, pad: 0.1 })          // one Float32Array per speech segment, \"split by silence\"\n\nlet outT = project(out.map, 12.4)                              // where did input t=12.4s land after cutting?\n```\n\n| Param | Default | |\n|---|---|---|\n| `fs` | `44100` | Sample rate, Hz |\n| `mode` | `'shorten'` | `'shorten'` \\| `'remove'` \\| `'trim'` |\n| `minSilence` | `0.5` | s — a pause shorter than this is never touched, in any mode but `trim` |\n| `maxSilence` | `0.25` | s — `shorten` target: pauses collapse to this length |\n| `pad` | `0.1` | s — `remove` target: silence kept on each side bordering speech |\n| `threshold` | `null` | dB — absolute override for the VAD's adaptive floor (see below) |\n| `fade` | `0.01` | s — equal-power crossfade length at every cut |\n| `frameSize` / `hopSize` | `1024` / `512` | forwarded to `vad()` |\n| `merge` | `0.15` | s — speech gaps shorter than this are bridged into one segment |\n\n`threshold` trades away `vad()`'s energy+spectral-flatness decision for a plain absolute-dB gate on frame energy (same STFT frame grid, no flatness check — an absolute level has no \"is it tonal\" component to combine with). Leave it `null` for the adaptive per-file floor `vad()` computes; set it when you know the true noise floor and want a fixed cutoff instead.\n\nRuns once over the whole signal — like every whole-render kernel in this family (`denoise`, `dereverb`), it needs the full clip, not a block at a time. Multi-channel input analyses the mono mix; the same cuts and crossfade windows apply to every channel identically.\n\n**What this does not do:** no ML VAD — `@audio/vad`'s energy+flatness decision is classical DSP, tuned for close-miced narration, not far-field or noisy conference audio. No music-aware pause detection — a rest under `minSilence` in a musical passage looks identical to a speech pause and gets cut/shortened the same way; this is a speech tool, not a general silence-trimmer for mixed program audio.\n\n**Use when:** podcast/voiceover \"smart speed\" playback prep, batch-trimming long pauses out of narration, splitting a take into per-line clips, or stripping room tone from the head/tail of a recording.\n\n---\n\nPart of [@audio/denoise](https://github.com/audiojs/denoise) — the denoise family umbrella.\n\nMIT © [audiojs](https://github.com/audiojs)\n","readmeFilename":"README.md"}