fft.js is a javascript library that makes it easy to analyze real-time audio input.
init(samples)
requests microphone input and sets up a buffer with the given number of samples. samples
must be between 32 and 2048.
fft()
returns an array of integers between 0 and 255. Each item in the array is a frequency band. The integer is its amplitude.
setup()
returns true if microphone input has been granted.
var fftjs = new FFTJS();
fftjs.init(32);
$('button#fft-button').on('click', function() {
$('#fft-display').text(JSON.stringify(fftjs.fft()));
});