The MzSpectogramClient is a useful template for how to write your own frequency analysis plugin where more control over the transform process is necessary, or you want to implement a transform other than a Discrete Fourier Transform, such as a wavelet transform. Also, the analysis window applied to the audio signal in MzSpectrogramHost is controlled by the host (usually selected by the user, or set to a default type). If your plugin needs a specific analysis window which cannot be supplied by the host, then you should use a client-based transform as given in this example plugin. While MzSpectrogramHost just calculates the magnitude spectrum directly from the complex spectrum data sent by the host, MzSpectrogramClient requires three prepatory steps to generate the spectrum in the process() function:
Notice that the parameter list of the makeMagnitudeSpectrum() function had to be changed from the one in MzSpectrogramHost because the output of the fft() function does not interleave the real and imaginary components of the complex spectrum.
Also notice that the function getInputDomain returns the value TimeDomain rather than FrequencyDomain since the client plugin receives time data and will calculate its own frequency domain data.
The source code for the plugin was last modified on 23 Jun 2006.