Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spectrum Analyser draws the wrong number of bars #81

Open
captbaritone opened this issue Nov 28, 2014 · 0 comments
Open

Spectrum Analyser draws the wrong number of bars #81

captbaritone opened this issue Nov 28, 2014 · 0 comments
Milestone

Comments

@captbaritone
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant