Instance Method

setPreferredPolarPattern:error:

Selects the preferred directivity configuration for the data source.

Declaration

- (BOOL)setPreferredPolarPattern:(AVAudioSessionPolarPattern)pattern error:(NSError * _Nullable *)outError;

Parameters

pattern

The directivity configuration to use.

outError

On input, a pointer to an error object. If an error occurs, the pointer is an NSError object that describes the error. If you don’t want error information, pass in nil.

Return Value

YES if a request was successfully made, otherwise NO.

Discussion

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

selectedPolarPattern

The directivity configuration currently in use by the data source.

supportedPolarPatterns

The set of directivity configurations supported by the data source.

preferredPolarPattern

The preferred directivity configuration for the data source.

AVAudioSessionPolarPattern

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.