Finding the frequencies given in a wav file
Polyphonic pitch estimation is still a difficult problem.  Search on the MIREX forum for current research papers.  Simplistic spectrum based approaches usually require component pitches with extremely simple timbres (nearly pure unmodulated sine waves, etc.) rarely found in real-life polyphonic music.  More typical polyphonic music can contain a dense set of overlapping overtones plus other transient noises.  More complicated timbres creating polyphonic chords may require a statistical pattern matching based approach (against a database of potential instrument sounds), and/or machine learning algorithms, in addition to any signal processing for spectrum and envelope information.