How do I use the audio capture callback properly?

Hello fellow SDL devs,

I am not sure how to use the audio capture callback properly in SDL2.

https://forums.libsdl.org/viewtopic.php?p=51881

I am using example code above and I modified it below.

I modified the code from Ryan gordon’s example, but the sound is pretty choppy.

Can somebody point me to the right direction?

I’m surprised you hear anything at all with that code.

You set the callback for both devices, but you only want to have it on the capture device.

Don’t divide the length by 4 in the callback. The queues and callbacks only work with sizes in bytes.

opps, I will take a look and try again

Thank, now it works