|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
Offline waveform-preserving LUFS normalizer with a hard true-peak ceiling. More...
#include <LoudnessNormalizer.h>
Classes | |
| struct | Result |
| Measurements and the constant-gain decision for one run. More... | |
Public Types | |
| enum class | Status : std::uint8_t { Success , NoMeasurableLoudness , EmptyInput , InvalidSampleRate , NonFiniteInput , NumericalFailure } |
| Completion or conservative no-mutation outcome. More... | |
Public Member Functions | |
| void | setTargetLUFS (T target) noexcept |
| Sets the target integrated loudness (default -23 LUFS). | |
| T | getTargetLUFS () const noexcept |
| void | setTruePeakCeilingDb (T ceilingDb) noexcept |
| Sets the true-peak ceiling (default -1 dBTP). | |
| T | getTruePeakCeilingDb () const noexcept |
| template<int MaxChannels> | |
| Result | normalize (AudioBuffer< T, MaxChannels > &audio, double sampleRate) |
Normalizes audio in place with one validated constant gain. | |
Offline waveform-preserving LUFS normalizer with a hard true-peak ceiling.
Threading: offline and single-threaded. The caller owns the buffer exclusively for the duration of normalize(). The two parameter controls are lock-free atomic words and may be changed between runs; changing either while a run is in progress is not supported.
| T | Sample type (float or double). |
Definition at line 70 of file LoudnessNormalizer.h.
|
strong |
Completion or conservative no-mutation outcome.
| Enumerator | |
|---|---|
| Success | |
| NoMeasurableLoudness | |
| EmptyInput | |
| InvalidSampleRate | |
| NonFiniteInput | |
| NumericalFailure | |
Definition at line 74 of file LoudnessNormalizer.h.
|
inlinenoexcept |
Definition at line 107 of file LoudnessNormalizer.h.
|
inlinenoexcept |
Definition at line 126 of file LoudnessNormalizer.h.
|
inline |
Normalizes audio in place with one validated constant gain.
| audio | Complete owning buffer; every runtime channel is bound. |
| sampleRate | Finite positive sample rate in Hz. |
Loudness uses channel 0 for mono and channels 0/1 for wider buffers. True peak and gain application cover every runtime channel up to the buffer's compile-time MaxChannels. Every failure status is decided before the first write and leaves audio bitwise unchanged.
Definition at line 145 of file LoudnessNormalizer.h.
|
inlinenoexcept |
Sets the target integrated loudness (default -23 LUFS).
Definition at line 100 of file LoudnessNormalizer.h.
|
inlinenoexcept |
Sets the true-peak ceiling (default -1 dBTP).
Finite values are clamped to [-40, 0] dBTP. Non-finite requests leave the current control value unchanged.
Definition at line 118 of file LoudnessNormalizer.h.