Class

AVAudioSessionPortDescription

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

Declaration

@interface AVAudioSessionPortDescription : NSObject

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 property to get information about the active set of input and output ports. To change the current audio routing, call the setPreferredInput:error: method. For example, on a device with a wired headset attached, the audio session’s 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:error: method to select the headset or built-in microphone for audio input.

Topics

Getting the Port Attributes

portName

A descriptive name for the port.

portType

The type of the port.

AVAudioSessionPort

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

channels

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

AVAudioSessionChannelDescription

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

UID

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

hasHardwareVoiceCallProcessing

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

Managing a Port’s Data Sources

dataSources

The available data sources for the port.

selectedDataSource

The currently selected audio data source for the port.

preferredDataSource

The preferred audio data source for the port.

- setPreferredDataSource:error:

Sets the preferred audio data source for the port.

Constants

Input Port Types

These values represent the port types available for audio input.

Output Port Types

These values represent the port types available for audio output.

I/O Port Types

These values represent the port types available for either audio input or output.

Relationships

Inherits From

See Also

Working with Audio Routes

currentRoute

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

AVAudioSessionRouteDescription

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

inputAvailable

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

availableInputs

An array of input ports available for audio routing.

preferredInput

The preferred input port for audio routing.

- setPreferredInput:error:

Sets the preferred input port for audio routing.

inputDataSource

The currently selected input data source.

inputDataSources

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

- setInputDataSource:error:

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

outputDataSources

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

outputDataSource

The currently selected output data source.

- setOutputDataSource:error:

Sets the output data source for an audio session.

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:

Temporarily changes the current audio route.

inputIsAvailable

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

Deprecated