Skip to content

[2/6] feat: measure loudness blocks from decoded audio - #300

Merged
dazzatronus merged 1 commit into
feat/duck-1-depsfrom
feat/duck-2-loudness
Nov 18, 2026
Merged

dazzatronus merged 1 commit into
feat/duck-1-depsfrom
feat/duck-2-loudness

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Choosing a dip level needs speech and music loudness measured the way the render measures them. This decodes a file once at 48 kHz and produces the same 400 ms blocks at a 100 ms hop that ffmpeg's ebur128 reports (BS.1770 K-weighting). Gating then uses the shared integratedLoudness.

  • Tested against ffmpeg's integrated loudness for seven synthetic signals: tolerance ±0.15 LU, all within 0.05.
  • Filtering runs in slices of about 8 ms and yields between them, so the editor keeps drawing while a file is measured. In Chrome, a 10-minute bed measured in one pass held the main thread for 0.3 s, and for 1.35 s with the CPU slowed 4×. Sliced, no task runs over 50 ms, and the blocks are identical.
  • Adds a Vite alias for @shotstack/shotstack-canvas/duck. It sits ahead of the bare-package alias, which would otherwise swallow the subpath.

Verify: npm run verify:ci.

Stack (squash into main in order)

# PR Adds Why separate
[1/6] #304 schemas 1.25.0 and canvas 2.15.0 Dependency bump
[2/6] #300 ← this PR Loudness blocks from decoded audio Pure measurement, tested against ffmpeg
[3/6] #301 Ducked preview and export Levels, preview and export only work together
[4/6] #302 Duck references survive delete and paste Repairs edits; revertible alone
[5/6] #303 Speed and volume guards on ducked clips Keeps existing controls valid for loaded edits
[6/6] #305 Duck control in the audio toolbar The user-facing control

@dazzatronus
dazzatronus merged commit a441a1d into main Nov 18, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2026
# [2.33.0](v2.32.1...v2.33.0) (2026-11-18)

### Features

* add a Duck control to the audio toolbar ([#305](#305)) ([8ca685a](8ca685a))
* keep duck references valid when clips are deleted or pasted ([#302](#302)) ([a62eedb](a62eedb))
* keep speed and volume edits valid on ducked audio clips ([#303](#303)) ([94e3cc5](94e3cc5))
* measure loudness blocks from decoded audio ([#300](#300)) ([a441a1d](a441a1d))
* preview and export ducked audio ([#301](#301)) ([2401c56](2401c56))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant