Answer the question
In order to leave comments, you need to log in
How to get the frequency?
I am using the Web Audio API.
I connect the microphone to the analyzer.
context = new AudioContext();
microphone = context.createMediaStreamSource(stream);
analyser = context.createAnalyser();
analyser.fftSize = 2048;
microphone.connect(analyser);
fFrequencyData = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(fFrequencyData);
Answer the question
In order to leave comments, you need to log in
Let's start with the fact that the sound into the microphone does not come at the same frequency. It's a whole range of frequencies. The getByteFrequencyData method returns this spectrum, more precisely ... it divides the spectrum into parts, each element of which determines, in other words, the average sound volume at these frequencies.
Can you tell me what you need to do? Display a spectrogram?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question