Wave files sample the "sound" at given frequency and record the data (pitch, frequency etc). The more often you sample, the better the quality. You have check the wav file format to see what each of those "snapshots" contains, then, start comparing the first "snapshot" of file 1 to first "snapshot" of file 2 and so forth. Get the % difference between samples and average. Something like that should do the trick.