Skip to main content

Crate lufsgen

Crate lufsgen 

Source
Expand description

LUFS Generator Library for Android

A memory-efficient streaming LUFS (Loudness Units Full Scale) calculator that processes audio chunk-by-chunk without loading entire files into memory.

§Features

  • Streaming audio decoders for MP3, OGG, WAV, FLAC, AAC, M4A, and MP4 formats
  • Automatic format detection from stream content (magic bytes)
  • Memory-efficient chunk-based processing
  • EBU R128 compliant loudness measurement

§Example

use lufsgen::LufsCalculator;
use std::path::Path;

let calc = LufsCalculator::default();

// From file path - format is auto-detected
let lufs = calc.calculate_from_file(Path::new("song.mp3"))?;

// Supports many formats: mp3, ogg, wav, flac, aac, m4a, mp4
let lufs_flac = calc.calculate_from_file(Path::new("song.flac"))?;

Re-exports§

pub use error::LufsError;
pub use error::Result;
pub use decoders::AudioDecoder;
pub use decoders::SymphoniaDecoder;
pub use decoders::create_decoder;
pub use decoders::create_decoder_from_path;
pub use lufs::LufsCalculator;
pub use lufs::LufsResult;

Modules§

decoders
Audio decoder trait and unified format detection
error
Error types for LUFS calculation library
lufs
LUFS calculator with streaming audio processing

Constants§

SUPPORTED_EXTENSIONS
Supported audio file extensions
VERSION
Library version

Functions§

is_audio_file
Check if a file has a supported audio extension