Instance Method


Selects the preferred directivity configuration for the data source.


func setPreferredPolarPattern(_ pattern: AVAudioSession.PolarPattern?) throws



The directivity configuration to use.

Return Value

true if a request was successfully made, otherwise false.


Calling this method requests a change to the selected polar pattern. To determine whether the change has taken effect, inspect the selectedPolarPattern property.

If the data source and its owning port are in use, using this method to change the directivity configuration is likely to result in a route reconfiguration.

Set a preferred polar pattern only after setting the audio session’s category and mode, and activating the session.

See Also

Configuring Microphone Directivity

var selectedPolarPattern: AVAudioSession.PolarPattern?

The directivity configuration currently in use by the data source.

var supportedPolarPatterns: [AVAudioSession.PolarPattern]?

The set of directivity configurations supported by the data source.

var preferredPolarPattern: AVAudioSession.PolarPattern?

The preferred directivity configuration for the data source.

struct AVAudioSession.PolarPattern

Constants that describe the possible polar patterns of the data source on an iOS device.

Data Source Polar Patterns

These values represent a data source’s available polar patterns.