FFTExplorer is a free (GPL) Linux (Xwindows GUI-based) utility that performs spectral analysis on real-time data from a sound card or other source, and can analyze the spectra of various sound file types. It can also accept data from many kinds of applications in plain-text form by way of the "named pipe" feature of Linux (example code provided in the documentation).