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

# setInputGain(_:)

Changes the input gain to the specified value.

## Declaration

```swift
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

Discussion Before calling this method, check the value in the isInputGainSettable property to make sure the input gain level is settable for the current inputs.

## See Also

### Setting input gain

- [inputGain](avfaudio/avaudiosession/inputgain.md)
- [isInputGainSettable](avfaudio/avaudiosession/isinputgainsettable.md)
