admin管理员组文章数量:1384122
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 = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(array);
However using analyser.getFloatFrequencyData(array)
returns an array of data:
var array = new Float32Array(analyser.frequencyBinCount);
analyser.getFloatFrequencyData(array);
I'm using a signal chain as follows:
Source
-> Analyser
-> ScriptProcessor
-> Context Destination
So why can I not get frequency data in byte form?
Thanks in advance.
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 = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(array);
However using analyser.getFloatFrequencyData(array)
returns an array of data:
var array = new Float32Array(analyser.frequencyBinCount);
analyser.getFloatFrequencyData(array);
I'm using a signal chain as follows:
Source
-> Analyser
-> ScriptProcessor
-> Context Destination
So why can I not get frequency data in byte form?
Thanks in advance.
Share Improve this question asked Feb 3, 2013 at 20:56 RobotEyesRobotEyes 5,2508 gold badges47 silver badges61 bronze badges3 Answers
Reset to default 3Without 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.
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.
Check if smoothingTimeConstant
is set to 1
. When it is so, getFloatFrequencyData
always returns an array of zeroes.
本文标签: javascriptWeb Audio API analyser node getByteFrequencyData returning blank arrayStack Overflow
版权声明:本文标题:javascript - Web Audio API analyser node getByteFrequencyData returning blank array - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744456305a2607007.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论