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

# setInputGain(_:)

Changes the input gain to the specified value.

```
func setInputGain(_ gain: Float) throws
```

## Parameters

`gain`

The new gain value, which must be in the range `0.0` to `1.0`, where `0.0` represents the lowest gain setting and `1.0` represents the highest gain setting.

## Discussion

Before calling this method, check the value in the [`isInputGainSettable`](/documentation/AVFAudio/AVAudioSession/isInputGainSettable) property to make sure the input gain level is settable for the current inputs.

---

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)