Web audio API: FFT data in firefox is different from data in chrome when using media stream?

I am trying to do a frequency analysis of the data I receive from my microphone using the Web Audio API. I need realtime data (as much as you can get in realtime with a 1024 sample window size).

I am using createMediaStreamSource

node for source. I was using FFT data from the node parser using the getByteFrequencyData

( sample size = 1024

) method .

The data from the FFT array is completely different from chrome and firefox (in firefox, the frequency spectrum is always smaller in size (smaller vector size) and smaller in value (lower values), unlike Chrome where it seems Ok compared to other FFT algorithms in Audacity , eg). Even when I used the Audio recorder from https://webaudiodemos.appspot.com/AudioRecorder/index.html and put the recordings into one of the audio analyzer apps (audacity in windows) I get this (image) .

I would like to know why the frequency spectrum in Firefox is different from the frequency spectrum in chrome.

Thanks for any help.

+3


source to share


1 answer


This is because we (Firefox) automatically apply processing (echo cancellation, noise cancellation) on the input AND use a sampling rate of 16 kHz on the input audio stream.

This will change, but how is it now, sorry.



It will be possible to query the input sample rate and disable any processing in the future.

+3


source







All Articles