• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AudioUnitGetProperty with Swift 3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioUnitGetProperty with Swift 3


  • Subject: AudioUnitGetProperty with Swift 3
  • From: Benjamin Federer <email@hidden>
  • Date: Wed, 19 Oct 2016 13:13:10 +0200

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: AudioUnitGetProperty with Swift 3
      • From: Matt Grippaldi <email@hidden>
  • Prev by Date: Re: MusicSequenceFileLoad Returns -1 on iOS10 (AudioToolbox/MusicPlayer)
  • Next by Date: Re: AudioUnitGetProperty with Swift 3
  • Previous by thread: Querying "Ambient Noise Reduction" property
  • Next by thread: Re: AudioUnitGetProperty with Swift 3
  • Index(es):
    • Date
    • Thread