Sending ADC and Processing it on RPi to a WAV file

Many things you are missing.

The 9600 baud rate will slow down considerably the speed you can get it into the Pi.

Using serial print will result in a very inefficient transfer as will sending a line feed at the end of each print. You should be sending the sample as two bytes using serial write.

You are not synchronising the sending of the sample with the acquisition of the sample, this will result in missing samples, or sending samples more than once.

You can not generate a WAV file on the fly, you need to have the whole sample before you can fill in the headers in the file. You will have to do some work at the Piend for this. Also a WAV file needs to know the sample rate and you have no way of knowing how fast that code is sampling.

In short instrutables are crap, mainly written by people who think they know stuff but don’t.