Web Audio API analyser node getByteFrequencyData returning blank array

后端 未结 3 507
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 01:05

I\'m trying to access FFT data from the analyser node using analyser.getByteFrequencyData(array) but it seems to return a blank array:

var array         


        
相关标签:
3条回答
  • 2021-01-06 01:31

    Check if smoothingTimeConstant is set to 1. When it is so, getFloatFrequencyData always returns an array of zeroes.

    0 讨论(0)
  • 2021-01-06 01:41

    Without seeing more of your code, my best guess is that you have the minDecibels and maxDecibels set to a range that is over the data you're pumping through the analyser, so it's getting zeroed out.

    0 讨论(0)
  • 2021-01-06 01:45

    What are the odds that one of you got the data before playback started, so there was nothing to read yet? If that might be the case, try to call getByteFrequencyData after playback is started.

    0 讨论(0)
提交回复
热议问题