Contents

AudioConverterSetProperty(_:_:_:_:)

Sets the value of an audio converter object property.

Declaration

func AudioConverterSetProperty(_ inAudioConverter: AudioConverterRef, _ inPropertyID: AudioConverterPropertyID, _ inPropertyDataSize: UInt32, _ inPropertyData: UnsafeRawPointer) -> OSStatus

Parameters

  • inAudioConverter:

    The audio converter to set a property value on.

  • inPropertyID:

    The property whose value you want to set.

  • inPropertyDataSize:

    The size, in bytes, of the property value.

  • inPropertyData:

    The value you want to apply to the specified property.

Return Value

A result code.

Discussion

You can employ the property mechanism, for example, to split a monaural input to both channels of a stereo output. You would do this as follows:

 SInt32 channelMap[2] = {0, 0}; // array size should match the number of output channels
 AudioConverterSetProperty (
    theConverter,
    kAudioConverterChannelMap,
    sizeof(channelMap),
    channelMap
);

See Also

Configuring Audio Converter Properties