Hi,
I just updated my macos from sierra to mojave and my xcode 9 to xcode 10.1, i am still using swift 4.0...
I am using cocoa touch framework and accelerate framework...
After the above update, the xcode has build error, i.e.
Cannot convert value of type '[Float]' to expected argument type 'Float'
The error occurs at the following code extract:
private var window:[Float]!
private var size:Int
self.size = 1000;
self.window = [Float](repeating: 0.0, count: size)
vDSP_hamm_window(&self.window!, UInt(size), 0)//error happens here
The same error message also occurs here:
private var complexBuffer: DSPSplitComplex!
private var magnitudes: [Float]!
private var halfSize:Int
private var log2Size:Int
private var fftSetup:FFTSetup
private var hasPerformedFFT: Bool = false
vDSP_fft_zrip(self.fftSetup, &(self.complexBuffer!), 1, UInt(self.log2Size), Int32(FFT_FORWARD))
self.magnitudes = [Float](repeating: 0.0, count: self.halfSize)
vDSP_zvabs(&(self.complexBuffer!), 1, &self.magnitudes!, 1, UInt(self.halfSize)) //error occurs here
May I know why this error occurs ? and how to fix this error ?
Please help
Kind Regards,
peter2013