Skip to main content

Module eqloud_loader

Module eqloud_loader 

Source
Expand description

Decode + equal-loudness convenience: a single “perceptual load” scalar.

This is a cold-path convenience (not the zero-heap hot path): it takes a complete WAV byte buffer and returns one number summarising how loud the content is to a human ear, combining three existing primitives:

  1. decode_wav → PCM, then to_mono_f32 → mono samples.
  2. Non-overlapping BLOCK-length FFT magnitude spectra (real_fft_magnitude).
  3. apply_equal_loudness A-weighting per block.

The returned value is the root-mean-square of the A-weighted magnitude spectrum, averaged over all analysis blocks — an equal-loudness-weighted spectral energy proxy. Two recordings of equal physical amplitude but different spectral content (e.g. a 1 kHz tone vs. a 50 Hz rumble) yield different perceptual loads, with mid-band content weighted higher.

Constants§

BLOCK
FFT analysis block size (power of two) used for the perceptual-load spectrum.

Functions§

perceptual_load_from_wav
Compute the equal-loudness-weighted “perceptual load” of a WAV byte buffer.