Sets the preferred input port for audio routing.
- iOS 7.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
AVAudioobject describing the port to use for input.
Session Port Description
On input, a pointer to an error object. If an error occurs, the pointer is set to an
NSErrorobject that describes the error. If you do not want error information, pass in
YES if a request was successfully made, or
Setting the preferred input port requests a change to the input audio route. To determine whether the change takes effect, use the
The value of the
in parameter must be one of the
AVAudio objects in the
available array. If this parameter specifies a port that is not already part of the current audio route and the app’s session controls audio routing, this method initiates a route change to use the preferred port.
You must set a preferred input port only after setting the audio session’s category and mode and activating the session.