Skip to content

Add Source::loudness via ebur128#895

Draft
4wn51dq wants to merge 2 commits into
RustAudio:masterfrom
4wn51dq:feature/loudness
Draft

Add Source::loudness via ebur128#895
4wn51dq wants to merge 2 commits into
RustAudio:masterfrom
4wn51dq:feature/loudness

Conversation

@4wn51dq

@4wn51dq 4wn51dq commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Wraps the ebur128 crate (a pure-Rust port of libebur128) behind a new loudness feature flag, exposing EBU R128 / ITU-R BS.1770 loudness measurement as a passthrough Source adapter.

  • Source::loudness() — chains onto any source, passes audio through unchanged
  • momentary_lufs() (400 ms), short_term_lufs() (3 s), integrated_lufs() (gated, whole-program)
  • Handles mono, stereo, and multi-channel; conditional compilation for 64bit feature
  • Analyzer resets on seek (loudness history is position-dependent)

What's included

  • src/source/loudness.rs — the adapter
  • tests/loudness.rs — 4 integration tests (plausible LUFS, silence, louder-is-higher, stereo passthrough)
  • Cargo.tomlloudness = ["dep:ebur128"] feature + optional dependency
  • CHANGELOG.md entry

What's not included (yet)

  • Examples — waiting for API feedback before writing these
  • SpanTracker integration for mid-stream sample rate / channel changes

Test plan

  • cargo test --lib --features loudness (75 pass)
  • cargo test --test loudness --features loudness (4 pass)
  • cargo test --doc --features loudness (68 pass)
  • cargo clippy --all-features -- -D warnings
  • cargo fmt --check
  • Builds with loudness + 64bit combined

Refs #757

4wn51dq added 2 commits June 25, 2026 03:12
Adds a `loudness` feature that wraps the ebur128 crate in a passthrough
Source exposing momentary, short-term, and integrated LUFS. Includes
integration tests and a changelog entry.

Refs RustAudio#757
@4wn51dq 4wn51dq marked this pull request as ready for review June 25, 2026 06:14
@4wn51dq 4wn51dq marked this pull request as draft June 25, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant