Buffer wave is a float[][] that I use later in code to draw the wave.
Is it the best way to do it or may I have better performance? I mean, if I just set outbuffer = inbuffer, data is not passing to the outbuffer and no sound is played. Is processing every single bin necessary to have the DSP working? Is possible to just read signal and store it in the bufferWave array without the need to assigning every float to the outbuffer?

Hi,
You can just do memcpy(outbuffer, inbuffer, length * inchannels * sizeof(float)); if the in and out channels are the same which they usually are (unless you specifically change the output format of the dsp).

just write to a shared memory buffer in the dsp callback, and in the main thread read from the same buffer. If you’re displaying the buffer on the screen then writing to it wont matter if you display the same buffer more than once, or if you miss some.

To avoid tearing you would probably lock the code that reads and writes with a criticalsection/mutex, because you’d only be protecting 1 memcpy, it should be fast enough. (alternate solution is to double buffer).