Distortion/static noise on microphone input

So I’m trying to get Audio input going, and tweak Ryan’s solution a bit.

I’m using SoLoud as my base Audio library and it requires both -1.0 - 1.0 Float samples, and requests audio instead of accepts it.

I’m taking the data from the input device, putting it into a Uint8, then when SoLoud’s getAudio is called, I’m casting it to a float and doing memcpy over to the buffer SoLoud provides.

It seems like it’s close to working… I’m getting distortion/static that mirrors the dynamics of any microphone input… and if I print some of the float buffers they look like they should. I’m going wrong somewhere but.

Can someone point me in the right direction?