# comparing 2 audio files in c#

I have 2 audio .wav files recorded by the the same person with the same word. Each audio file has a format of 16bit, 44.1kHz and is a mono channel. I would like to know how to compare these 2 audio files if it is by the same person. What I know is to process the files to produce a floating point result of values between -1 and 1 and apply fft on it and compare the frequency. What I would like to know is how to compare the audio files, prefably with the code which shows the comparison and if possible the steps before that(processing to become values btw 1 and -1).Thanks. Im relatively new in this area so I would appreciate If u guys would help me out. I'm currently using a metro application in vs. I would prefer not to use any library like naudio or bass.net but I would still accept any answer. A step by step solution starting from utilizing the .wav file is much appreciated. I have been trying to search topics related to what I'm doing but what I have found are small parts of it.

• Please be more explicit about what you mean by "comparing". See for example my answer here: dsp.stackexchange.com/a/1872/943, and describe examples of what you consider as "identical" and "different". – pichenettes Jul 2 '13 at 6:57
• I guess by comparing you mean that two utterances by the same speaker should be classified as similar, whereas the same utterance from different speakers should be classified as dissimilar. You should probably search for "speaker identification". – Matt L. Jul 2 '13 at 10:41
• I'm adding an explanation for the vote-to-close: I think this question is old, low quality, the answer is also low quality. I don't think there's much to be saved here, or that the question can be edited to be better. Additionally, there's this question covering a similar topic. – penelope Dec 25 '13 at 21:01

I'm thinking the signals could be compared by

$D = \mathcal{F}^{-1}(\mathcal{F}(A) - \mathcal{F}(B))$

Where A and B are the two audio files to be compared.

I guess after that you could come up with some criteria for deciding that the voices are different. Perhaps when $|D|$ goes over some threshold.

You could also use Cross correlation

Using some other library to help with this would save time. But I haven't done this with audio files.

AForge Looks like it has FFT although I haven't used it.

• $\mathcal{F}^{-1}(\mathcal{F}(A) - \mathcal{F}(B))=\mathcal{F}^{-1}(\mathcal{F}(A))-\mathcal{F}^{-1}(\mathcal{F}(B))=A-B$. Hmmmmmm. – Matt L. Jul 2 '13 at 19:03