Class LoudnessMeter

Constructors

  • Parameters

    • node: AudioWorkletNode

      The constructed loudness-meter AudioWorkletNode.

    • source: AudioNode

      The node whose output is being metered. Its output is branched into node here; the source's existing connections are untouched (the audible path is preserved).

    • Optional silentSink: GainNode

      Optional zero-gain node owned by the meter. When supplied, the worklet output is connected through it to sinkDestination, keeping the metering worklet on a pulled graph without adding audible output.

    • Optional sinkDestination: AudioNode

      Destination for the owned zero-gain sink.

    Returns LoudnessMeter

Properties

latest: LoudnessReading = ...
onUpdate?: ((reading) => void)

Invoked on every report from the worklet (~10×/s) with the latest readings. Assign a function to observe live loudness; leave undefined to poll the cached getters instead.

Type declaration

silentSink?: GainNode
sinkDestination?: AudioNode
source: AudioNode

Accessors

Methods

  • Stops metering: removes the branch tap from the source and detaches the message listener. The audible path (the source's other edges) is untouched.

    Returns void

  • Resets the integrated-loudness gate accumulator and the true-peak hold on the worklet (momentary/short-term keep sliding). Use to start a fresh integrated measurement of a new programme.

    Returns void