Implement the reset function everywhere

This commit is contained in:
Robbert van der Helm
2022-03-08 00:42:58 +01:00
parent 70d3b5d557
commit fd8bd025c8
5 changed files with 27 additions and 16 deletions

View File

@@ -116,14 +116,18 @@ impl Plugin for Stft {
_buffer_config: &BufferConfig,
context: &mut impl ProcessContext,
) -> 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(WINDOW_SIZE);
context.set_latency_samples(self.stft.latency_samples());
true
}
fn reset(&mut self) {
// Normally we'd also initialize the STFT helper for the correct channel count here, but we
// only do stereo so that's not necessary. Setting the block size also zeroes out the
// buffers.
self.stft.set_block_size(WINDOW_SIZE);
}
fn process(
&mut self,
buffer: &mut Buffer,