captbaritone / captbaritone/webamp
Spectrum Analyser draws the wrong number of bars
Open
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 796
- PR merge metrics
- No merged PRs in 30d
Description
The `analyser.getByteFrequencyData` method gives us an array of values, which is just what we want! Unfortunately, the number of values in the array is always a power of two (half of `analyser.fftSize`) and we need 19.
I think our only option is to use far more bins than we need, and simply average length/19 of the bins for each bar. It's going to lead to some inaccuracy along the way, but I can't see a better approach.
Currently we are getting 32 bins and drawing all of them, even though many are off the canvas. Gross.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.