Really goofed on the division and modulus on some of the data. I fixed that, and the wav file is effectively constructed and recognized by audacity. However the wave file is just noise