View Single Post
Old 06-21-2015, 08:01 AM   #5
Human being with feelings
Tale's Avatar
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,059

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.:

Originally Posted by mviljamaa View Post
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.

Originally Posted by mviljamaa View Post
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.

Last edited by Tale; 06-25-2015 at 04:33 PM. Reason: Fixed typos
Tale is offline   Reply With Quote