I want to capture sound from mic or other input device and to store that data in the array and after that analize it with FFT using javascript, searched tons of sites and topics, couldn't find anything useful
1 Answers
Sure you can, the API also provides an FFT analyzer (but only for live audio streams). It's called Web Audio API and is currently a draft, but is well supported by WebKit (you'll need to use prefixes) and a little less by Gecko. Look also http://caniuse.com/#feat=audio-api.
To get microphone audio, you'll need to use the getUserMedia method, defined in the Media Capture and Streams draft, once you get the MediaStream you can create a MediaStreamAudioSourceNode, and attach it to the other nodes. To record audio samples, I'd suggest to try ScriptProcessorNode, the other useful node is the Analyzer node.
Here is a little experiment I did some months ago, I tried it only on Chrome, but should work with any WebKit browser. It basically takes the microphone audio stream and passes it to an analyzer node, which performs every frame (screen frame) an FFT, which is draw on the canvas and use to determinate the note (you only have to set the threshold with a mouse click anywhere on the canvas). Then the guessed note is reproduced on an oscillator node.