---
title: "setPreferredInputOrientation(_:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiosession/setpreferredinputorientation(_:)"
---

# setPreferredInputOrientation(_:)

Sets the audio session’s preferred stereo input orientation.

## Declaration

```swift
func setPreferredInputOrientation(_ orientation: AVAudioSession.StereoOrientation) throws
```

## Parameters

- `orientation`: The stereo orientation.

## Discussion

Discussion Configure the input orientation to match how the user is holding the device when they begin recording. In a single-window app, set the input orientation to a value corresponding to the app’s user interface orientation.

## See Also

### Enabling stereo recording

- [inputOrientation](avfaudio/avaudiosession/inputorientation.md)
- [preferredInputOrientation](avfaudio/avaudiosession/preferredinputorientation.md)
- [AVAudioSession.StereoOrientation](avfaudio/avaudiosession/stereoorientation.md)
