<!--
{
  "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/AVAudioSessionPortDescription",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioSessionPortDescription"
  },
  "title" : "AVAudioSessionPortDescription"
}
-->

# AVAudioSessionPortDescription

Information about the capabilities of the port and the hardware channels it supports.

```
class AVAudioSessionPortDescription
```

## Overview

A port description object describes a single input or output port associated with an audio route. Examples of audio ports include a device’s built-in speaker, a microphone on a wired headset, and a Bluetooth device supporting the Advanced Audio Distribution Profile (A2DP).

You can query the audio session’s [`currentRoute`](/documentation/AVFAudio/AVAudioSession/currentRoute) property to get information about the active set of input and output ports. To change the current audio routing, call the [`setPreferredInput(_:)`](/documentation/AVFAudio/AVAudioSession/setPreferredInput(_:)) method. For example, on a device with a wired headset attached, the audio session’s [`availableInputs`](/documentation/AVFAudio/AVAudioSession/availableInputs) array may contain two port descriptions: one for the headset microphone and one for the device’s built-in microphone. You can use the audio session’s [`setPreferredInput(_:)`](/documentation/AVFAudio/AVAudioSession/setPreferredInput(_:)) method to select the headset or built-in microphone for audio input.

## Topics

### Getting the Port Attributes

[`portName`](/documentation/AVFAudio/AVAudioSessionPortDescription/portName)

A descriptive name for the port.

[`portType`](/documentation/AVFAudio/AVAudioSessionPortDescription/portType)

The type of the port.

[`AVAudioSession.Port`](/documentation/AVFAudio/AVAudioSession/Port)

A structure that defines the available input and output port types.

[`channels`](/documentation/AVFAudio/AVAudioSessionPortDescription/channels)

An array of channel objects that describe the port’s input or output channels.

[`AVAudioSessionChannelDescription`](/documentation/AVFAudio/AVAudioSessionChannelDescription)

A class that describes a hardware channel on the current device.

[`uid`](/documentation/AVFAudio/AVAudioSessionPortDescription/uid)

A system-assigned unique identifier (UID) for the port.

[`hasHardwareVoiceCallProcessing`](/documentation/AVFAudio/AVAudioSessionPortDescription/hasHardwareVoiceCallProcessing)

A Boolean value that indicates whether the associated hardware port has built-in processing for two-way voice communication.

[`isSpatialAudioEnabled`](/documentation/AVFAudio/AVAudioSessionPortDescription/isSpatialAudioEnabled)

A Boolean value that indicates whether the port supports spatial audio playback.

### Managing a Port’s Data Sources

[`dataSources`](/documentation/AVFAudio/AVAudioSessionPortDescription/dataSources)

The available data sources for the port.

[`selectedDataSource`](/documentation/AVFAudio/AVAudioSessionPortDescription/selectedDataSource)

The currently selected audio data source for the port.

[`preferredDataSource`](/documentation/AVFAudio/AVAudioSessionPortDescription/preferredDataSource)

The preferred audio data source for the port.

[`setPreferredDataSource(_:)`](/documentation/AVFAudio/AVAudioSessionPortDescription/setPreferredDataSource(_:))

Sets the preferred audio data source for the port.

### Accessing the port extension

[`bluetoothMicrophoneExtension`](/documentation/AVFAudio/AVAudioSessionPortDescription/bluetoothMicrophoneExtension)

An optional port extension that describes capabilities relevant to Bluetooth microphone ports.

[`AVAudioSessionPortExtensionBluetoothMicrophone`](/documentation/AVFAudio/AVAudioSessionPortExtensionBluetoothMicrophone)

An object that describes capabilities of Bluetooth microphone ports.

[`AVAudioSessionCapability`](/documentation/AVFAudio/AVAudioSessionCapability)

Describes whether a specific capability is supported and if that capability is currently enabled



---

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)