|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
One requested mono/stereo interval per instance; feed several instances the same blocks to measure overlapping intervals in one source pass. The region is always measured as an independent finite fragment. Optional continuous loudness observations are separate, explicitly scoped results; they never replace or masquerade as the region's integrated loudness. More...
#include <AudioIntervalAnalyzer.h>
Classes | |
| struct | Interval |
| Absolute, nonnegative frame coordinates [begin,end), per channel. More... | |
| struct | Loudness |
| Readouts at the last complete 100 ms hop within input. committedEnd is a source-frame position, not the caller's block boundary. pendingFrames are included in sample statistics but not loudness windows. integrated/range support bounds the complete windows supplied to gating; rejected windows inside that span do not contribute to the final value. More... | |
| struct | Measurement |
| A numeric value with its validity and actual window/gate support. Invalid/unavailable values are NaN. Silence has an explicit status; meter floors remain -100 LUFS/dBTP, not a claim of physical negative infinity. IIR state may depend on earlier samples within Loudness::input. More... | |
| struct | Result |
| Immutable-by-convention result, safe to copy to another thread. More... | |
Public Types | |
| enum class | Context { Independent , IncludeContinuous } |
| enum class | Status { Pending , Complete , Truncated , InvalidArgument , DiscontinuousInput , NonFiniteInput } |
| enum class | Validity { NotRequested , Valid , Silence , Empty , TooShort , BelowGate , Incomplete , InvalidInput , NumericalError } |
Public Member Functions | |
| AudioIntervalAnalyzer () noexcept | |
| bool | prepare (const AudioSpec &spec, Interval requested, Context context=Context::Independent, std::int64_t streamOrigin=0) noexcept |
| Starts a fresh measurement, resetting all filters, windows and gates. streamOrigin is the first frame that processBlock must receive. It must precede or equal requested.begin. Independent mode can start directly at requested.begin; continuous mode observes exactly [streamOrigin,end). Only mono/stereo are accepted. False leaves an explicit invalid result. | |
| bool | processBlock (AudioBufferView< const T > block, std::int64_t firstFrame) noexcept |
| Consumes a contiguous block at firstFrame; clips both region edges. No samples at or after requested.end enter any measurement. Blocks after completion are ignored. Gaps/overlaps, layout/size errors and non-finite samples in a measured scope fail explicitly. Ignored audio is not scanned. | |
| Result | finish () noexcept |
| Seals the result, including the finite region's true-peak tail. Call at EOF or after completing the interval. Idempotent. Early EOF yields Truncated and unavailable measurements, with the actual measured interval. The tail is evaluated on copied Core state, never as extra loudness audio. | |
One requested mono/stereo interval per instance; feed several instances the same blocks to measure overlapping intervals in one source pass. The region is always measured as an independent finite fragment. Optional continuous loudness observations are separate, explicitly scoped results; they never replace or masquerade as the region's integrated loudness.
Definition at line 32 of file AudioIntervalAnalyzer.h.
|
strong |
| Enumerator | |
|---|---|
| Independent | |
| IncludeContinuous | |
Definition at line 41 of file AudioIntervalAnalyzer.h.
|
strong |
| Enumerator | |
|---|---|
| Pending | |
| Complete | |
| Truncated | |
| InvalidArgument | |
| DiscontinuousInput | |
| NonFiniteInput | |
Definition at line 42 of file AudioIntervalAnalyzer.h.
|
strong |
| Enumerator | |
|---|---|
| NotRequested | |
| Valid | |
| Silence | |
| Empty | |
| TooShort | |
| BelowGate | |
| Incomplete | |
| InvalidInput | |
| NumericalError | |
Definition at line 44 of file AudioIntervalAnalyzer.h.
|
inlinenoexcept |
Definition at line 90 of file AudioIntervalAnalyzer.h.
|
inlinenoexcept |
Seals the result, including the finite region's true-peak tail. Call at EOF or after completing the interval. Idempotent. Early EOF yields Truncated and unavailable measurements, with the actual measured interval. The tail is evaluated on copied Core state, never as extra loudness audio.
Definition at line 179 of file AudioIntervalAnalyzer.h.
|
inlinenoexcept |
Starts a fresh measurement, resetting all filters, windows and gates. streamOrigin is the first frame that processBlock must receive. It must precede or equal requested.begin. Independent mode can start directly at requested.begin; continuous mode observes exactly [streamOrigin,end). Only mono/stereo are accepted. False leaves an explicit invalid result.
Definition at line 98 of file AudioIntervalAnalyzer.h.
|
inlinenoexcept |
Consumes a contiguous block at firstFrame; clips both region edges. No samples at or after requested.end enter any measurement. Blocks after completion are ignored. Gaps/overlaps, layout/size errors and non-finite samples in a measured scope fail explicitly. Ignored audio is not scanned.
Definition at line 131 of file AudioIntervalAnalyzer.h.