-
Notifications
You must be signed in to change notification settings - Fork 47
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
TempiFFT fix #7
Comments
Thanks! But I still get an error with that code:
|
It looks like the complexBuffer parameter needs to be DSPSplitComplex instead of DSPSplitComplex! |
complexBuffer is a class property that can't be initialized (sensibly) at init time, so it must be either DSPSplitComplex? or DSPSplitComplex!. |
The error goes away if you put the reference to 'complexBuffer' in parenthesis.
Unfortunately, after trying that, I was getting runtime crashes after a few cycles through audio rendering. Through a bit of trial and error, I found out the runtime errors were occurring from instantiating DSPSplitComplex with locally instantiated Float arrays at the init call. I was able to make it work by declaring the empty real and imaginary Float arrays as private variables in the class instance. Since that all happens at the init call, I also changed to the 'complexBuffer' from 'DSPSplitComplex!' to 'DSPSplitComplex'. Tested on Swift 4.0, XCode 9.0 beta 4 |
I do not see a historical PR for this - can you create one for the benefit of other users of this project? Thx! |
On line 166 in TempiFFT.swift, the call should be
analysisBuffer.withUnsafeBufferPointer { $0.baseAddress!.withMemoryRebound(to: DSPComplex.self, capacity: analysisBuffer.count) {
vDSP_ctoz($0, 2, &complexBuffer, 1, UInt(halfSize)) }
}
that should help get vDSP_ctoz working again
The text was updated successfully, but these errors were encountered: