Instance Method

setFormat(_:)

Sets the bus’s audio format.

Declaration

func setFormat(_ format: AVAudioFormat) throws

Parameters

format

The desired audio format.

outError

Returns an error if the operation failed, or nil if it succeeded.

Return Value

  • true if the operation succeeded.

  • false if the operation failed.

Discussion

Audio units can generally be expected to support the AVAudioFormat standard format (deinterleaved 32-bit float), at any sample rate.

Channel counts can be more complex. See the channelCapabilities reference for a more complete discussion.

See Also

Bus Methods and Properties

var format: AVAudioFormat

The audio format and channel layout of audio being transferred on the bus.

var isEnabled: Bool

Determines whether the bus is active.

var name: String?

A name for the bus.

var index: Int

The index of this bus in its containing array.

var ownerAudioUnit: AUAudioUnit

The audio unit that owns the bus.

var supportedChannelLayoutTags: [NSNumber]?

An array of audio channel layout tags.

var contextPresentationLatency: TimeInterval

Information about latency in the audio unit’s processing context.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software