Using FFT to Unit Test a Music Player I'd like to validate changes to our app music player in our Continuous Integration unit tests (more like integration tests, really). My thoughts were to start with an audio file that contains only a pure tone, or a series of pure tones. Our automated test would stream this file over the internet and play it through our player. We would capture the output using MTAudioProcessingTap. This output would go through and FFT and the pass/fail test would be check for the existence of only the original frequencies.

Would this work? I'm thinking this would catch pops and glitches, but not necessarily discontinuities in the output.
The phase vocoder algorithm used with overlapped FFT frames might easily catch certain kinds of discontinuities in pure sine waves.

If the audio file is compressed, note that this process itself may add certain kinds of distortion.  So you would need to find an experimental threshold.