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

# AudioHardwareStream

Instances of the AudioHardwareStream class encapsulate a single audio stream, which represents
a single buffer of data for transferring across the user/kernel boundary. As such, AudioStreams
are the gatekeepers of format information. Each has its own format and list of available formats.

```
class AudioHardwareStream
```

## Topics

### Initializers

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

### Instance Properties

[`var availablePhysicalFormats: [AudioStreamRangedDescription]`](/documentation/CoreAudio/AudioHardwareStream/availablePhysicalFormats)

An array of AudioStreamRangedDescriptions that describe the available data formats for
the stream. The physical format refers to the data format in which the hardware for the
owning device performs its IO transactions.

[`var availableVirtualFormats: [AudioStreamRangedDescription]`](/documentation/CoreAudio/AudioHardwareStream/availableVirtualFormats)

An array of AudioStreamRangedDescriptions that describe the available data formats for
the stream. The virtual format refers to the data format in which all IOProcs for the
owning device will perform IO transactions.

[`var direction: AudioHardwareDirection`](/documentation/CoreAudio/AudioHardwareStream/direction)

An AudioHardwareDirection indicating whether this is an input or output stream.

[`var isActive: Bool`](/documentation/CoreAudio/AudioHardwareStream/isActive)

A Bool where a value of true indicates that the stream is enabled for IO.

[`var latency: Int`](/documentation/CoreAudio/AudioHardwareStream/latency)

An Int containing the number of frames of latency in the stream.

[`var physicalFormat: AudioStreamBasicDescription`](/documentation/CoreAudio/AudioHardwareStream/physicalFormat)

An AudioStreamBasicDescription that describes the current data format for the stream.
The physical format refers to the data format in which the hardware for the owning device
performs its IO transactions.

[`var startingChannel: Int`](/documentation/CoreAudio/AudioHardwareStream/startingChannel)

An Int that specifies the first element in the owning device that corresponds to element
one of this stream.

[`var terminalType: UInt32`](/documentation/CoreAudio/AudioHardwareStream/terminalType)

A UInt32 whose value describes the general kind of functionality attached to the stream.
Constants for some of the values for this property can be found in the enum in the
AudioStream Constants section of AudioHardwareBase.h.

[`var virtualFormat: AudioStreamBasicDescription`](/documentation/CoreAudio/AudioHardwareStream/virtualFormat)

An AudioStreamBasicDescription that describes the current data format for the stream.
The virtual format refers to the data format in which all IOProcs for the owning device
will perform IO transactions.

### Instance Methods

[`func setIsActive(Bool) throws`](/documentation/CoreAudio/AudioHardwareStream/setIsActive(_:))

Set the isActive property.

[`func setPhysicalFormat(AudioStreamBasicDescription) throws`](/documentation/CoreAudio/AudioHardwareStream/setPhysicalFormat(_:))

Set the physicalFormat property.

[`func setVirtualFormat(AudioStreamBasicDescription) throws`](/documentation/CoreAudio/AudioHardwareStream/setVirtualFormat(_:))

Set the virtualFormat property.

## Relationships

### Inherits From

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

### Conforms To

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

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

---

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)