Skip to main content

Crate rlvgl_audio_meters_core

Crate rlvgl_audio_meters_core 

Source
Expand description

rlvgl-audio-meters-core — L0 ballistic state machines and dB calibration helpers for the rlvgl audio-meters initiative.

This crate is the canonical implementation of the meter ballistics defined in docs/audio-meters/00-concepts.md §5. Both the rlvgl widget tree (Rust) and the TypeScript companion port (@rlvgl/audio-meters) consume the same input fixture sequences and MUST produce identical outputs to within a small floating-point epsilon. See the tests/parity.rs test and the checked-in fixtures under fixtures/.

§Scope

  • Ballistic state machines: VU, PPM Type I/IIa/IIb, Digital Peak, RMS, LUFS-M/S/I, Instant.
  • Calibration offsets: pure additive dB shift applied at display time.

§Out of scope (caller’s responsibility)

  • Sample acquisition (PCM, AudioWorklet, mic capture).
  • Peak / RMS detection on raw audio samples.
  • Weighting filters (A, C, K).
  • True-peak oversampling.
  • Sample-rate conversion.

Callers feed the meter pre-converted dBFS at display refresh rate, one call to BallisticState::update per displayed frame. See docs/audio-meters/00-concepts.md §9 for the full update contract.

Re-exports§

pub use integrated::RelativelyGatedLufsI;

Modules§

integrated
Two-pass gated integrated loudness per ITU-R BS.1770-4 §5.1.

Structs§

BallisticState
Per-meter state. Construct with BallisticState::new, advance once per displayed frame with BallisticState::update.
Dbfs
Decibels relative to digital full scale.

Enums§

Ballistic
Frozen variant set. Concepts §5; registration policy: Standards Action.

Constants§

NEG_INFINITY_FLOOR_DB
Lower clamp for ballistic state (dB domain). Below this value, the reading is held; this both prevents -inf from log10 and gives PPM / digital decay a finite floor.

Functions§

apply_calibration
Apply a calibration offset to a dBFS reading.