addFrom? startSample?

Ok, I’m trying to do something super basic here, I am trying to add the main buffer to a temporary buffer just to send it back again, this is just for practice and understanding how this works but I can’t see why this one is turning in so huge artifacts like weird noise throughout the whole spectrum. What I guess is something with the destStartSample or sourceStartSample

tempBuffer.addFrom(channel, 0, buffer, channel, 0, bufferLength, 1.0f);

buffer.addFrom(channel, 0, tempBuffer, channel, 0, tempBufferLength, 1.0f);

Edit; The Buffersize, sample rate is same ass mainbuffer

Did you clear tempBuffer first? If not, it contains whatever was there before that first addFrom call, which gets the data from buffer added to it. So you could have random noise there.

And when you call addFrom back to buffer, you’re again adding (not setting) those values back to the original data. Even if you cleared tempBuffer first, that’s going to double the values in buffer after you’re done those two calls.

If you wanted to copy the data, not add them together, then you need to use copyFrom, not addFrom.