<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAudio",
  "identifier" : "/documentation/CoreAudio/AudioHardwareControl",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Audio"
    ],
    "preciseIdentifier" : "s:9CoreAudio0B15HardwareControlC"
  },
  "title" : "AudioHardwareControl"
}
-->

# AudioHardwareControl

Instances of the AudioHardwareControl class encapsulate a single audio control, which provides
properties that describe/manipulate a particular aspect of the owning device such as gain,
mute, data source selection, etc.

```
class AudioHardwareControl
```

## Topics

### Initializers

[`init(id: AudioObjectID)`](/documentation/CoreAudio/AudioHardwareControl/init(id:))

### Instance Properties

[`var availableItems: [UInt32]`](/documentation/CoreAudio/AudioHardwareControl/availableItems)

An array of UInt32s that represent the IDs of all the items available.

[`var booleanValue: Bool`](/documentation/CoreAudio/AudioHardwareControl/booleanValue)

A Bool that represents the value of the boolean control.

[`var element: AudioObjectPropertyElement`](/documentation/CoreAudio/AudioHardwareControl/element)

An AudioObjectPropertyElement that indicates which element of the owning
device the control applies to.

[`var scope: AudioObjectPropertyScope`](/documentation/CoreAudio/AudioHardwareControl/scope)

An AudioObjectPropertyScope that indicates which part of the owning device
the control applies to.

[`var selectedItems: [UInt32]`](/documentation/CoreAudio/AudioHardwareControl/selectedItems)

An array of UInt32s that are the IDs of the items currently selected.

[`var sliderRange: [UInt32]`](/documentation/CoreAudio/AudioHardwareControl/sliderRange)

An array of two UInt32s that represents the inclusive range of values the slider control
can take.

[`var sliderValue: UInt32`](/documentation/CoreAudio/AudioHardwareControl/sliderValue)

A UInt32 that represents the value of the slider control.

[`var stereoPanChannels: [UInt32]`](/documentation/CoreAudio/AudioHardwareControl/stereoPanChannels)

An array of two UInt32s that indicate which elements of the device the signal is being panned between.

[`var stereoPanValue: Float`](/documentation/CoreAudio/AudioHardwareControl/stereoPanValue)

A Float where 0.0 is full left, 1.0 is full right, and 0.5 is center.

[`var volumeDecibelRange: AudioValueRange`](/documentation/CoreAudio/AudioHardwareControl/volumeDecibelRange)

An AudioValueRange that contains the minimum and maximum dB values the control can have.

[`var volumeDecibelValue: Float`](/documentation/CoreAudio/AudioHardwareControl/volumeDecibelValue)

A Float that represents the value of the volume control in dB.

[`var volumeScalarValue: Float`](/documentation/CoreAudio/AudioHardwareControl/volumeScalarValue)

A Float that represents the value of the volume control. The range is between 0.0 and
1.0 (inclusive).

### Instance Methods

[`func convertToDecibels(fromScalar: Float) throws -> Float`](/documentation/CoreAudio/AudioHardwareControl/convertToDecibels(fromScalar:))

Convert a volume scalar value to the equivalent dB value.

[`func convertToScalar(fromDecibels: Float) throws -> Float`](/documentation/CoreAudio/AudioHardwareControl/convertToScalar(fromDecibels:))

Convert a volume dB value to the equivalent scalar value.

[`func selectorItemKind(fromID: UInt32) throws -> UInt32`](/documentation/CoreAudio/AudioHardwareControl/selectorItemKind(fromID:))

This property returns a UInt32 that identifies the kind of selector item the item ID refers to.

[`func selectorItemName(fromID: UInt32) throws -> String`](/documentation/CoreAudio/AudioHardwareControl/selectorItemName(fromID:))

Translates the given item ID into a human readable name.

[`func setBooleanValue(Bool) throws`](/documentation/CoreAudio/AudioHardwareControl/setBooleanValue(_:))

Set the booleanValue property.

[`func setSelectedItems([UInt32]) throws`](/documentation/CoreAudio/AudioHardwareControl/setSelectedItems(_:))

Set the selectedItems property.

[`func setSliderValue(UInt32) throws`](/documentation/CoreAudio/AudioHardwareControl/setSliderValue(_:))

Set the sliderValue property.

[`func setStereoPanValue(Float) throws`](/documentation/CoreAudio/AudioHardwareControl/setStereoPanValue(_:))

Set the stereoPanValue property.

[`func setVolumeDecibelValue(Float) throws`](/documentation/CoreAudio/AudioHardwareControl/setVolumeDecibelValue(_:))

Set the decibelScalarValue property.

[`func setVolumeScalarValue(Float) throws`](/documentation/CoreAudio/AudioHardwareControl/setVolumeScalarValue(_:))

Set the volumeScalarValue property.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`AudioHardwareObject`](/documentation/CoreAudio/AudioHardwareObject)

---

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)