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:
decode_wav→ PCM, thento_mono_f32→ mono samples.- Non-overlapping
BLOCK-length FFT magnitude spectra (real_fft_magnitude). apply_equal_loudnessA-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.