I am struggling with this API and the syntax in Swift
audioBufferList = AudioBufferList(mNumberBuffers: 2, mBuffers: (AudioBuffer))
I don't know what (AudioBuffer) with ( ) means? Any ideas and how do I initialize it? This is from the headers:
public struct AudioBufferList {
public var mNumberBuffers: UInt32
public var mBuffers: (AudioBuffer) // this is a variable length array of mNumberBuffers elements
public init()
public init(mNumberBuffers: UInt32, mBuffers: (AudioBuffer))
}
Here is one way to initialize an AudioBufferList, with one empty mono buffer array, that you can pass to Audio Unit calls, such as AudioUnitRender() which then allocates and fills the buffer as needed :