<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioSession/setPreferredInputOrientation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioSession(im)setPreferredInputOrientation:error:"
  },
  "title" : "setPreferredInputOrientation(_:)"
}
-->

# setPreferredInputOrientation(_:)

Sets the audio session’s preferred stereo input orientation.

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

## Parameters

`orientation`

The stereo orientation.

## 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.

---

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)