Loudness and the mix
How vawe sums the audio tags into one track, what level that gives, and how to measure it or set a target.
vawe mixes the cuesA cue is one sound at one second, written as an <audio> tag with data-at. of a page as you write them. The level of the film is the sum of the gains you set. It does not normalise unless you ask. This page shows how to read that level and how to set a target. The tags and attributes are on Audio and are not repeated here.
How the mix works
One function, mixAndMux in harness/media/page-audio.mjs, builds the audio track for a draft and for a finalA final is the full-quality render: 60 fps, motion blur and the mixed audio, followed by a final check..
- The mixer reads each
<audio>tag. A cue has a start (data-at), a gain in dB (data-gain) and optional fades (data-fade-out). - It sums the tracks at their gains with an ffmpeg
amixgraph. The graph setsnormalize=0, so adding a track does not lower the others. - A
data-role="vo"cue ducksTo duck is to lower the music while a voice speaks. the music by 18 dB, with a 0.05 s attack and a 0.3 s release. The attributedata-ducksets another amount. - A safety limiter runs last. It lowers peaks and never raises a level.
- The result is encoded as AAC at 192 kbps and 48 kHz, and joined to the video.
data-gain is absolute. It replaces the default gain of a voice. Leave it off unless you move one cue on purpose.
The default level
A film with a few soft cues lands near -20 LUFS. The number is lufs_target in taste/build/limits.json. A draft or a final prints the real value:
page-audio: mix as written: [level] LUFS, [peak] dBTPThe sound check advises when the mix is outside -24 to -16 LUFS or the peak is above -3 dBFS. bin/vawe check review <page> --final warns when the mix is quieter than -30 or louder than -12 LUFS.
Measure the level
bin/vawe sound films/my-film/page.html --waveformThe verb writes one PNG of the mixed waveform and the loudness curve, and prints the LUFS and the true peak. Add --at 0.8,2.75 to read the cues that sound at those seconds. See Audio for the checks.
Set a target
Write a loudness meta in the page:
<meta name="loudness" content="-14">The value is in LUFS. The mixer then measures the mix and runs ffmpeg loudnorm (two passes, linear mode, true peak -1 dB) to that value, then the limiter. With no meta, no loudnorm runs. The number is yours: the platform pages that were read for Video specs by platform state no LUFS target for an upload, so vawe does not suggest one per platform.
| Page has | The final audio |
|---|---|
No loudness meta | The mix as written, with the safety limiter |
<meta name="loudness" content="-14"> | Normalised to -14 LUFS, then the limiter |
No <audio> tag | No audio track |
Limits
- A draft with
--fromor--tois silent, so it has no level. Run a whole draft, or runbin/vawe sound <page> --waveform. - After you set the meta, run
bin/vawe sound <page> --waveformand read the peak. - vawe measures integrated loudness (LUFS) and true peak. It does not measure short-term loudness.
Audio
Video specs by platform
Cut to the beat
From the blogLUFS for video: set a loudness target in code
Image to particles
Sample a photo into a seeded point cloud with imagePoints, then gather, light and film the points in three.js.
Video specs by platform
Aspect, size, length, frame rate, file size and loudness for YouTube, Shorts, Reels, TikTok, LinkedIn and X, with the official page and the date read.