Try this…
let nullPtr:UnsafeMutableRawPointer! = nil
Matt Grippaldi
[email protected] <mailto:[email protected]>
> On Oct 19, 2016, at 7:13 AM, Benjamin Federer <[email protected]> wrote:
>
> Hi there, especially the Core Audio team,
>
> The documentation for AudioUnitGetProperty() says:
>
> public func AudioUnitGetProperty(_ inUnit: AudioUnit, _ inID:
> AudioUnitPropertyID, _ inScope: AudioUnitScope, _ inElement:
> AudioUnitElement, _ outData: UnsafeMutableRawPointer, _ ioDataSize:
> UnsafeMutablePointer<UInt32>) -> OSStatus
>
>> outData: … Set this parameter to NULL when calling this function if you only
>> want to determine how much memory to allocate for a variable size property.
>
>
> I cannot, for the life of me, get Swift 3 to create a NULL pointer. With
> Swift 2 it seems this was possible. With Swift 3 I am supposed to pass in nil
> instead. But since outData is a non-optional I am not allowed to do that.
>
> Interestingly, AudioUnitGetPropertyInfo() also works with passing NULL for
> its inOut parameters, which are optionals:
>
> public func AudioUnitGetPropertyInfo(_ inUnit: AudioUnit, _ inID:
> AudioUnitPropertyID, _ inScope: AudioUnitScope, _ inElement:
> AudioUnitElement, _ outDataSize: UnsafeMutablePointer<UInt32>?, _
> outWritable: UnsafeMutablePointer<DarwinBoolean>?) -> OSStatus
>
> Is outData being a non-optional intentional and, if so, how should I pass in
> NULL?
>
> Thanks,
> Benjamin
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/coreaudio-api/mattg%40kinematicsystems.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com
This email sent to [email protected]