pub struct LookaheadDetector { /* private fields */ }Expand description
Detektor gain reduction berbasis sliding maximum pada window lookahead.
Detektor dipisahkan dari delay audio supaya beberapa channel bisa berbagi
satu detektor — dasar untuk stereo-linked limiting (LimiterProcessor).
Implementations§
Source§impl LookaheadDetector
impl LookaheadDetector
Sourcepub fn new(
sample_rate: f32,
ceiling_db: f32,
release_ms: f32,
lookahead_ms: f32,
) -> Self
pub fn new( sample_rate: f32, ceiling_db: f32, release_ms: f32, lookahead_ms: f32, ) -> Self
§Arguments
sample_rate- Frekuensi sampling (Hz)ceiling_db- Batas keluaran (dBFS, mis. -1.0)release_ms- Waktu pemulihan gain reduction (ms)lookahead_ms- Panjang window lookahead (ms)
Sourcepub fn latency_samples(&self) -> usize
pub fn latency_samples(&self) -> usize
Jumlah sample delay audio yang menyertai detektor ini.
pub fn current_gain(&self) -> f32
pub fn ceiling_linear(&self) -> f32
Sourcepub fn process_input_peak(&mut self, input_peak: f32) -> f32
pub fn process_input_peak(&mut self, input_peak: f32) -> f32
Memasukkan puncak input satu frame dan mengembalikan gain yang harus dipakai.
Attack bersifat instan: begitu puncak baru masuk window, gain langsung turun sehingga tidak ada sampel yang lolos di atas ceiling. Release dihaluskan eksponensial, dengan min-hold agar gain tidak naik sebelum transient melewati output.
pub fn reset(&mut self)
Auto Trait Implementations§
impl Freeze for LookaheadDetector
impl RefUnwindSafe for LookaheadDetector
impl Send for LookaheadDetector
impl Sync for LookaheadDetector
impl Unpin for LookaheadDetector
impl UnsafeUnpin for LookaheadDetector
impl UnwindSafe for LookaheadDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more