<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioSessionDataSourceDescription",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioSessionDataSourceDescription"
  },
  "title" : "AVAudioSessionDataSourceDescription"
}
-->

# AVAudioSessionDataSourceDescription

An object that defines a data source for an audio input or output, giving information such as the source’s name, location, and orientation.

```
class AVAudioSessionDataSourceDescription
```

## Overview

You obtain data source descriptions from the shared [`AVAudioSession`](/documentation/AVFAudio/AVAudioSession) object or the [`AVAudioSessionPortDescription`](/documentation/AVFAudio/AVAudioSessionPortDescription) objects corresponding to its input and output ports. Only built-in microphone ports on certain devices support the location, orientation, and polar pattern properties. If a port doesn’t support these features, the value of its [`dataSources`](/documentation/AVFAudio/AVAudioSessionPortDescription/dataSources) property is `nil`.

This class is especially useful for differentiating between microphone configurations on devices having more than one built-in microphone. Such devices may also support signal processing features for spatial filtering, or *beamforming*, in which the system makes the device more sensitive to audio signals from a particular direction. See `Data Source Polar Patterns` for more information.

## Topics

### Identifying a Data Source

[`dataSourceID`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/dataSourceID)

The system-assigned identifier for the data source.

[`dataSourceName`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/dataSourceName)

A human-readable name for the data source.

### Retrieving the Data Source Location

[`location`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/location)

The location of the data source on the device.

[`Location`](/documentation/AVFAudio/AVAudioSession/Location)

Constants that describe the location of the data source on device.

### Retrieving the Data Source Orientation

[`orientation`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/orientation)

The orientation of the data source relative to the device’s natural orientation.

[`Orientation`](/documentation/AVFAudio/AVAudioSession/Orientation)

Constants that indicate the directions in which a data source can point, relative to the device’s natural orientation.

### Configuring Microphone Directivity

[`selectedPolarPattern`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/selectedPolarPattern)

The data source’s active polar pattern.

[`supportedPolarPatterns`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/supportedPolarPatterns)

The set of directivity configurations supported by the data source.

[`preferredPolarPattern`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/preferredPolarPattern)

The preferred directivity configuration for the data source.

[`-  setPreferredPolarPattern:error:`](/documentation/AVFAudio/AVAudioSessionDataSourceDescription/setPreferredPolarPattern(_:))

Selects the preferred directivity configuration for the data source.

[`PolarPattern`](/documentation/AVFAudio/AVAudioSession/PolarPattern)

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

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)