1
0
Fork 0

Add missing latency compensation in STFT example

The latency introduced by the linear phase filter wasn't compensated
for.
This commit is contained in:
Robbert van der Helm 2022-05-08 03:14:56 +02:00
parent 6400e2d71d
commit c5841cbe33

View file

@ -111,7 +111,10 @@ impl Plugin for Stft {
_buffer_config: &BufferConfig, _buffer_config: &BufferConfig,
context: &mut impl ProcessContext, context: &mut impl ProcessContext,
) -> bool { ) -> bool {
context.set_latency_samples(self.stft.latency_samples()); // The plugin's latency consists of the block size from the overlap-add procedure and half
// of the filter kernel's size (since we're using a linear phase/symmetrical convolution
// kernel)
context.set_latency_samples(self.stft.latency_samples() + (FILTER_WINDOW_SIZE as u32 / 2));
true true
} }