<!--
{
  "documentType" : "article",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/audio-routing",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Audio routing"
}
-->

# Audio routing

Inspect and configure audio routes, ports, and data sources.

## Topics

### Inspecting the current route

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

A description of the current audio route’s input and output ports.

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

An object that describes the input and output ports associated with a session’s audio route.

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

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

[`AVAudioSessionRouteChangeNotification`](/documentation/AVFAudio/AVAudioSession/routeChangeNotification)

A notification the system posts when its audio route changes.

### Configuring inputs

[`inputAvailable`](/documentation/AVFAudio/AVAudioSession/isInputAvailable)

A Boolean value that indicates whether an audio input path is available.

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

An array of input ports available for audio routing.

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

The preferred input port for audio routing.

[`-  setPreferredInput:error:`](/documentation/AVFAudio/AVAudioSession/setPreferredInput(_:))

Sets the preferred input port for audio routing.

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

The currently selected input data source.

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

An array of available data sources for the audio session’s current input port.

[`-  setInputDataSource:error:`](/documentation/AVFAudio/AVAudioSession/setInputDataSource(_:))

Selects a data source for the audio session’s current input port.

[`AVAudioSessionAvailableInputsChangeNotification`](/documentation/AVFAudio/AVAudioSession/availableInputsChangeNotification)

### Configuring outputs

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

An array of available output data sources for the current audio route.

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

The currently selected output data source.

[`-  setOutputDataSource:error:`](/documentation/AVFAudio/AVAudioSession/setOutputDataSource(_:))

Sets the output data source for an audio session.

[`AVAudioSessionDataSourceDescription`](/documentation/AVFAudio/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.

[`-  overrideOutputAudioPort:error:`](/documentation/AVFAudio/AVAudioSession/overrideOutputAudioPort(_:))

Temporarily changes the current audio route.



---

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)