I am trying to find the given note in an audio file. It has been specifically told that each file contains only one note. So i directly took fft and found the corresponding frequency and then mapped it to corresponding note.Out of my test cases some are giving the correct answer, but some are not.
The pitch of a musical note is very often not the same thing as the frequency peak in an FFT magnitude computation.
This is due to all the overtones and harmonics within interesting musical sounds, as opposed to single pure (and boring sounding) sinewaves. Please investigate pitch detection/estimation algorithms that do more than look for a bare FFT magnitude peak. A little reading on human psychoacoustics, pitch perception, audiology, and the physics of musical instruments might also help.