I am trying to implement a phase vocoder overlap-add pitch shifting algorithm for part of a plugin I'm writing. I have done this kind of thing offline before and I understand the theory, but this is the first time I've attempted to do realtime processing. This seems to add extra difficulty.
Here's my issue: the audio routing library I'm using gives me 1024 samples of audio at a time, and I must return 1024 samples of supposedly pitch-shifted audio each time. I know that I can just use some kind of ring buffer or something to cache the samples needed for my overlap-add algorithm, but what do I return the very first time? That is, what do I do with the first 1024 samples of audio I'm given? It seems that with an overlap factor of 4, I would need at least 1792 (256*3 + 1024) samples before I could return my first 1024 samples, because of the overlap requirement.
Am I doomed to just output silence the first go-round, until I get enough samples to actually start doing the algorithm? It doesn't seem ideal to delay the audio, even if only by a couple of milliseconds. I would like it to be sample accurate if at all possible, even if there's a slight drop in quality for the first few windows of data.
thanks in advance