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

"Size must be a power of 2" on iPhone 11 Pro #14

Open
Bcow7 opened this issue Dec 18, 2019 · 1 comment
Open

"Size must be a power of 2" on iPhone 11 Pro #14

Bcow7 opened this issue Dec 18, 2019 · 1 comment

Comments

@Bcow7
Copy link

Bcow7 commented Dec 18, 2019

There's an assert failure "Size must be a power of 2" when instantiating the FFT on iPhone 11 Pro. I can replicate it with iPhone 11 Pro simulator.

Any idea of what is going wrong on this new device? Is it because of new CPU?

@jcutting7
Copy link

jcutting7 commented Feb 29, 2020

Yep - I have the same issue. It is because the number of samples returned by the microphone is only around ~940 or 941.

One thing I just tried was to pass 1024 as a fixed size to the initializer, rather than the size of my sample, i.e.
TempiFFT(withSize: 1024, sampleRate: Constants.AUDIO_SAMPLE_RATE)
instead of
TempiFFT(withSize: CMSampleBufferGetNumSamples(sampleBuffer), sampleRate: Constants.AUDIO_SAMPLE_RATE)

Although it runs without getting errors, unfortunately the bins give strange results. The hanning or something isn't right. My visualizer I had made just isn't right any more.

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

2 participants