mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Add proper overlap-add to the StftHelper
Doesn't make much sense without it.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use nih_plug::prelude::*;
|
||||
use std::pin::Pin;
|
||||
|
||||
const WINDOW_SIZE: usize = 2048;
|
||||
|
||||
struct Stft {
|
||||
params: Pin<Box<StftParams>>,
|
||||
|
||||
@@ -15,7 +17,7 @@ impl Default for Stft {
|
||||
Self {
|
||||
params: Box::pin(StftParams::default()),
|
||||
|
||||
stft: util::StftHelper::new(2, 512),
|
||||
stft: util::StftHelper::new(2, WINDOW_SIZE),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +58,7 @@ impl Plugin for Stft {
|
||||
) -> bool {
|
||||
// Normally we'd also initialize the STFT helper for the correct channel count here, but we
|
||||
// only do stereo so that's not necessary
|
||||
self.stft.set_block_size(512);
|
||||
self.stft.set_block_size(WINDOW_SIZE);
|
||||
context.set_latency_samples(self.stft.latency_samples());
|
||||
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user