I must be running out of RAM. I reduced some buffer sizes and it works.
Thanks for helping me out. I need this function done and nothing else too unfortunately lol.
I will test it out on my Arduino Due to see if it has enough.
Thanks for working it out with me.