I'm sorry, but I just don't know how to better explain this... Do you know what a FIFO queue is? If not, then look it up on Wikipedia or something, and then please re-read my explanation (here as well as in the other topic).
If you do know, then I would suggest implementing them instead of using simple buffers, e.g.:
Quote:
Originally Posted by mviljamaa
Here, first output the remaining samples from the outputBuffer (before we can replace it).
|
You can't do that, because your output
queue could hold more than nFrames samples. And you should not replace it, but rather add samples to it, which is why you need a
queue.
Quote:
Originally Posted by mviljamaa
Is the nFrames == 0 checking trusthworthy? I assume that it should be zero, when the playhead isn't passing over that sinewave file.
|
This is not relevant, but yeah, I do think your code should be able to handle nFrames == 0. However, there are probably not many hosts that will actually call your ProcessDoubleReplacing() with nFrames == 0, because then they could just as well not call it at all.