Search code examples
audioweb-audio-apifrequency-analysis

Adjust frequency range - Web Audio api analyser


I have been playing around with the web audio api.

I am using getByteFrequencyData to display the decibel data of frequency bands, however I would like to change the overall range in which the frequency bands are shown, as right now the important audio is all squashed into a couple a bands.

Any ideas on how to do this?

Thanks, Slidon


Solution

  • 1) Is this a problem with how you are displaying the data? i.e. are you displaying every bucket, or grouping them together?

    2) If it is a problem with the actual data you are getting and not how you are displaying it, try playing with AnalyserNode.fftSize. https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize This property defaults to 2048, which is the highest value you can use, so unless you have changed it somewhere, this shouldn't be the problem.

    Please post example code for a more specific answer. Thanks!