0

I am currently working with CoreAudio in Swift. And there is a structure called AudioBufferList. It has a property mBuffers, which has type (AudioBuffer) and described as "A variable length array of AudioBuffer structures".

Since Array in Swift is defined as [Type], and I can not find anything about declaring an Array as (Type) I do wonder how is that possible that (Type) is also an Array and how to work with it?

Thank you for your help.

1
  • Without more context your question is quite unclear. Please include the actual code you're having problem with. Commented Sep 5, 2017 at 9:53

1 Answer 1

1

This is not an array, it's the same as AudioBuffer without parentheses.

The manual says:

You can put parentheses around a named type or a compound type. However, adding parentheses around a type doesn’t have any effect. For example, (Int) is equivalent to Int. (from here)

Sign up to request clarification or add additional context in comments.

2 Comments

So the Apple documentation about AudioBufferList is simply misleading then.
@Igor I think the reason for having parentheses in the documentation is that the source file is generated automatically from Objective-C definitions, and nobody took time to clean it up manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.