The following code:
var mutableDataP = UnsafeMutablePointer<Int16>(audioBuffer.mData)
let stereoSampleArray = UnsafeMutableBufferPointer(
start: mutableDataP,
count: nBytesInBuffer/sizeof(Int16) // Int16 audio samples
)
gives the following error:
Cannot convert value of type 'UnsafeMutablePointer' to expected argument type 'UnsafeMutablePointer<_>'
What is an UnsafeMutablePointer<__> and how do I cast to it? I tried all the casting variations I could think of and got un-understandable diagnostics for each and I've run out of ideas. I find the documentation on the various UnsafeMutablePointer types unhelpful, and no mention at all of '<_>'.