That sure looks like your are including the .WAV file header as part of your data.

When you read your file in, and write it out, using the file operations, you are not accounting for the header.  The header can vary in size (it's actually three RIFF headers), but is usually 44 bytes long.