I have been trying to implement Google's Speech to Text API in iOS and I cam across this piece of code in their AudioController file. This piece of code
let buffers = UnsafeMutableBufferPointer<AudioBuffer>(start:
&bufferList.mBuffers, count: Int(bufferList.mNumberBuffers))
buffers[0].mNumberChannels = 1
buffers[0].mDataByteSize = inNumberFrames * 2
buffers[0].mData = nil
gives me this error
Initialization of 'UnsafeMutableBufferPointer<AudioBuffer>' results in a dangling buffer pointer
I've tried the solutions over on this question Warning: Initialization of 'UnsafeBufferPointer<T>' results in a dangling buffer pointer, but the solutions don't work as intended.
Any help?