Returns the amount of energy (volume) at a specific frequency, or the average amount of energy between two frequencies. Accepts Number(s) corresponding to frequency (in Hz), or a "string" corresponding to predefined frequency ranges ("bass", "lowMid", "mid", "highMid", "treble"). Returns a range between 0 (no energy/volume at that frequency) and 255 (maximum energy). NOTE: analyze() must be called prior to getEnergy(). analyze() tells the FFT to analyze frequency data, and getEnergy() uses the results to determine the value at a specific frequency or range of frequencies.
Syntax
getEnergy(frequency1, [frequency2])
Parameters
Will return a value representing energy at this frequency. Alternately, the strings "bass", "lowMid" "mid", "highMid", and "treble" will return predefined frequency ranges.
If a second frequency is given, will return average amount of energy that exists between the two frequencies.