After having read this and your other thread, I get the feeling that on thing is not clear to you:
bufferToFill is a buffer that contains the input samples first. After
getNextAudioBlock has returned the content of
bufferToFill will be interpreted as output samples.
This means, while processing audio you usually replace the input samples with the output samples while working on the same buffer. If you don’t do anything to the buffer, the input samples will equal the output samples (you asked why you experience this behavior in this thread :Audio App for mix input from external audio card starts with sound even if the getNextAudioBlock() is empty). This is why you need to clear the buffer if you want to output silence.
getReadPointer just returns you a const pointer, e.g. a pointer that allows read operation only on the underlying memory only. In fact
getWritePointer will point to the SAME memory location, the only difference is that
getWritePointer will allow you to change the content of that memory location, while
getReadPointer doesn’t. If you don’t need write access to the data, using
getReadPointer is the better choice.
I image you assumed that
getReadPointer will provide you access to your input samples, while
bufferToFill actually points to another memory region containing your output samples? I hope I got you right and didn’t explain something completely obvious to you