Contents

AudioUnitSetProperty(_:_:_:_:_:_:)

Sets the value of an audio unit property.

Declaration

func AudioUnitSetProperty(_ inUnit: AudioUnit, _ inID: AudioUnitPropertyID, _ inScope: AudioUnitScope, _ inElement: AudioUnitElement, _ inData: UnsafeRawPointer?, _ inDataSize: UInt32) -> OSStatus

Parameters

  • inUnit:

    The audio unit that you want to set a property value for.

  • inID:

    The audio unit property identifier.

  • inScope:

    The audio unit scope for the property.

  • inElement:

    The audio unit element for the property.

  • inData:

    The value that you want to apply to the property. May be NULL (see Discussion).

    Always pass property values by reference. For example, for a property value of type CFStringRef, pass it as &myCFString.

  • inDataSize:

    The size of the data you are providing in the inData parameter.

Mentioned in

Return Value

A result code.

Discussion

To clear an audio unit property value, set the inData parameter to NULL and set the inDataSize parameter to 0. Clearing properties works only for those properties that do not have a default value.

See Also

Configuring Audio Unit Properties