Instance Property


The available data sources for the port.


var dataSources: [AVAudioSessionDataSourceDescription]? { get }


This feature is only supported on certain devices and peripherals; for example, the data sources represent front- and rear-facing microphones on an iPhone equipped with such.

Some, but not all, USB ports will provide a set of data sources. For example, a USB audio interface may allow you to select between a built-in microphone or external microphone input. The output side may allow you to select between headphones or externally powered speakers. The audio session interface will represent the input and output sides of the USB interface as two separate ports of type usbAudio.

If this property is nil, the port does not support selecting between multiple data sources.

The contents of this array may change if the mode is changed for the AVAudioSession object owning the port.

See Also

Managing a Port’s Data Sources

var selectedDataSource: AVAudioSessionDataSourceDescription?

The currently selected audio data source for the port.

var preferredDataSource: AVAudioSessionDataSourceDescription?

The preferred audio data source for the port.

func setPreferredDataSource(AVAudioSessionDataSourceDescription?)

Sets the preferred audio data source for the port.