Meter also Level meter, VU meter, Peak meter

An audio level meter (a mixer's channel strip): peak and RMS in dB, green, yellow and red zones, a peak hold line and a clip mark, one bar per channel; setLevels() on every animation frame costs no render.

Source on GitHub

A mixer: a fader with its scale and a stereo meter per track, both on a desk's curve (taper="fader"; a test signal, no audio)
0.0 dB
Drums
-6.0 dB
Bass
-12.0 dB
Keys
4.0 dB
Master
The meter's own scale (scale), when there is no fader
Horizontal, with its own scale
Clear the clip marks
Code

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-meter> · RayMeter

Levels are dB (20 * log10 of the amplitude; -Infinity for silence). A peak goes up at once and falls at falloff dB/s, so call setLevels() on every frame; the hold line keeps the highest peak for hold ms. The bars are role=meter, its value (the loudest channel) updated a few times a second. Colors: --ray-meter-low, --ray-meter-mid, --ray-meter-high; length: the host's height (--ray-meter-length, 12rem), or its width when horizontal. Beside a fader (ray-slider orientation="vertical"), give both the same height and the meter --ray-meter-inset: half the slider's thumb length (0.4375rem for thumb="cap", 0.5625rem for the round one): and the same taper: its bars then line up with the slider's marks, which carry the numbers; leave the meter's own scale off.

PropertyAttributeTypeDefaultDescription
minminnumber-60The dB at the bottom: lower levels show nothing.
maxmaxnumber6The dB at the top.
warnwarnnumber-12Where the yellow zone starts (dB).
dangerdangernumber-3Where the red zone starts (dB).
clipclipnumber0A peak at or over it (dB) marks the channel as clipped (a red band at the top of its bar) until resetClip(), reset() or a click on the bar.
channelschannelsnumber1The bars: 1 (mono), 2 (stereo)…
orientationorientation reflectsvertical | horizontalverticalvertical: bars that rise, the scale before them (on the left, aligned against them); horizontal: bars that grow towards the inline end.
sizesize reflectsxs | sm | md | lgsmThe thickness of each bar.
holdholdnumber1500How long the peak hold line stays (ms); 0: no line.
fallofffalloffnumber24How fast a lower level falls (dB per second); 0: at once.
scalescale reflectsbooleanShows the dB scale on the left of the bars (6, 0, -6, -12, -24, -36, -48, -60 within min and max). Part of the meter, and optional: beside a fader, put the numbers on the fader (its marks) instead.
tapertaper reflectslinear | faderlinearHow the dB spread along the bar: linear, or fader (a mixing desk's curve, as ray-slider taper="fader"): beside a fader with that taper, give both the same one and the bars line up with its marks. The zones (warn, danger) and the scale follow it.
marks—arrayYour own scale, in dB (replaces the one of scale).
labellabelstringLevel (text meter.label)The accessible name.
EventDescription
ray-clipA channel's peak reached clip (once until its mark is cleared).
PartDescription
channelsThe bars (role=meter).
channelOne channel (data-clipped when clipped).
trackA bar's track.
peakThe peak level (translucent).
rmsThe RMS level (solid).
holdThe peak hold line.
scaleThe dB scale.
tickA label of the scale.

Texts

What it writes itself, in English; setStrings() translates them (Getting started: Languages).

KeyEnglish
meter.labelLevel
meter.value{value} dB
meter.silentSilence