5

I would like to work with percentages while doing some FFT with the web audio API.

To do so I need to know the range of the values the analyser.getByteFrequencyData returns.

I can't find anything about that, maybe someone knows?

Thanks

xavier.seignard
  • 11,254
  • 13
  • 51
  • 75

1 Answers1

13

analyser.getByteFrequencyData returns a normalized array of values between 0 and 255.

The length of the array is half the value of analyzer.fftSize. So if analyzer.fftSize = 1024 analyser.getByteFrequencyData will return an array with 512 values. Also see https://stackoverflow.com/a/14789992/4303873 for more information.

Community
  • 1
  • 1
RafaelKr
  • 915
  • 8
  • 18