Basic audio analyser. Returns back waveform and FFT analysis. Use analyserPeakLevel if you want sound level, or analyserFrequency if you just want FFT results.
constonData = (freq, wave, analyser) => { // Demo: Get FFT results just for 100Hz-1KHz. constfreqSlice = analyser.sliceByFrequency(100,1000,freq);
// Demo: Get FFT value for a particular frequency (1KHz) constamt = freq[analyser.getIndexForFrequency(1000)]; } analyserBasic(onData, {fftSize:512});
An Analyser instance is returned and can be controlled:
Basic audio analyser. Returns back waveform and FFT analysis. Use analyserPeakLevel if you want sound level, or analyserFrequency if you just want FFT results.
An
Analyser
instance is returned and can be controlled:Note: Browers won't allow microphone access unless the call has come from a user-interaction, eg pointerup event handler.