<!--
{
  "availability" : [
    "DriverKit: 21.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioDriverKit",
  "identifier" : "/documentation/AudioDriverKit/IOUserAudioBox",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AudioDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserAudioBox"
  },
  "title" : "IOUserAudioBox"
}
-->

# IOUserAudioBox

A container for other audio objects, typically audio devices and audio clock devices.

```
class IOUserAudioBox;
```

## Overview

Along with containing other audio objects, [`IOUserAudioBox`](/documentation/AudioDriverKit/IOUserAudioBox) publishes identifying information about itself and allows you to enable or disable the box. When disabled, the box’s contents aren’t available.

## Topics

### Creating an Audio Box

[`static OSSharedPtr<IOUserAudioBox> Create(IOUserAudioDriver *in_driver, bool in_is_acquirable, OSString *in_box_uid);`](/documentation/AudioDriverKit/IOUserAudioBox/Create)

Allocates and initializes an instance of the audio box class.

[`virtual bool init(IOUserAudioDriver *in_driver, bool in_is_acquirable, OSString *in_box_uid);`](/documentation/AudioDriverKit/IOUserAudioBox/init)

Initializes an instance of the audio box class.

[`class IOUserAudioDriver;`](/documentation/AudioDriverKit/IOUserAudioDriver)

A DriverKit provider object that manages communications with an audio device.

### Freeing an Audio Box

[`virtual void free();`](/documentation/AudioDriverKit/IOUserAudioBox/free)

Frees the audio box.

### Getting Information About the Class

[`virtual IOUserAudioClassID GetClassID();`](/documentation/AudioDriverKit/IOUserAudioBox/GetClassID)

Gets the audio class identifier of the object.

[`virtual IOUserAudioClassID GetBaseClassID();`](/documentation/AudioDriverKit/IOUserAudioBox/GetBaseClassID)

Gets the audio class identifier of the base class object.

[`enum IOUserAudioClassID : uint32_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioClassID)

An identifier for the type of audio object.

### Identifying the Box

[`OSSharedPtr<OSString> GetUID();`](/documentation/AudioDriverKit/IOUserAudioBox/GetUID)

Returns the UID of the audio box.

### Managing Box Contents

[`kern_return_t AddDevice(IOUserAudioDevice *in_device);`](/documentation/AudioDriverKit/IOUserAudioBox/AddDevice)

Adds an audio device to the audio box.

[`kern_return_t RemoveDevice(IOUserAudioDevice *in_device);`](/documentation/AudioDriverKit/IOUserAudioBox/RemoveDevice)

Removes an audio device from the audio box.

[`class IOUserAudioDevice;`](/documentation/AudioDriverKit/IOUserAudioDevice)

An audio clock device object that handles the configurations for running I/O.

[`kern_return_t AddClockDevice(IOUserAudioClockDevice *in_clock_device);`](/documentation/AudioDriverKit/IOUserAudioBox/AddClockDevice)

Adds an audio clock device to the audio box.

[`kern_return_t RemoveClockDevice(IOUserAudioClockDevice *in_clock_device);`](/documentation/AudioDriverKit/IOUserAudioBox/RemoveClockDevice)

Adds an audio clock device to the audio box.

[`class IOUserAudioClockDevice;`](/documentation/AudioDriverKit/IOUserAudioClockDevice)

An audio clock device object, used to synchronize and perform I/O.

### Managing Protection State

[`kern_return_t SetIsProtected(bool in_is_protected);`](/documentation/AudioDriverKit/IOUserAudioBox/SetIsProtected)

Sets a Boolean value that indicates if the box requires authentication before use.

[`bool IsProtected();`](/documentation/AudioDriverKit/IOUserAudioBox/IsProtected)

Returns a Boolean value that indicates if the box requires authentication before use.

### Managing Acquirability

[`virtual kern_return_t HandleChangeAcquireBox(bool in_acquire);`](/documentation/AudioDriverKit/IOUserAudioBox/HandleChangeAcquireBox)

Informs the box of a change to its acquisition state.

[`kern_return_t SetIsAcquired(bool in_is_acquired);`](/documentation/AudioDriverKit/IOUserAudioBox/SetIsAcquired)

Set the box’s acquisition state.

[`bool IsAcquired();`](/documentation/AudioDriverKit/IOUserAudioBox/IsAcquired)

Returns a Boolean value that indicates the box’s acquisition state.

[`kern_return_t SetIsAcquirable(bool in_is_acquirable);`](/documentation/AudioDriverKit/IOUserAudioBox/SetIsAcquirable)

Set the box’s acquirability state.

[`bool IsAcquirable();`](/documentation/AudioDriverKit/IOUserAudioBox/IsAcquirable)

Returns a Boolean value that indicates the box’s acquirabilty state.

[`kern_return_t SetAcquisitionFailure(kern_return_t in_failure_code);`](/documentation/AudioDriverKit/IOUserAudioBox/SetAcquisitionFailure)

Sets the error code to return when box acquisition fails.

[`kern_return_t GetAcquisitionFailure();`](/documentation/AudioDriverKit/IOUserAudioBox/GetAcquisitionFailure)

Returns the error code for use when box acquisition fails.

### Determining Media Support

[`kern_return_t SetHasAudio(bool in_has_audio);`](/documentation/AudioDriverKit/IOUserAudioBox/SetHasAudio)

Sets a Boolean value that indicates the box’s audio support.

[`bool HasAudio();`](/documentation/AudioDriverKit/IOUserAudioBox/HasAudio)

Returns a Boolean value that indicates the box’s audio support.

[`kern_return_t SetHasVideo(bool in_has_video);`](/documentation/AudioDriverKit/IOUserAudioBox/SetHasVideo)

Sets a Boolean value that indicates the box’s video support.

[`bool HasVideo();`](/documentation/AudioDriverKit/IOUserAudioBox/HasVideo)

Returns a Boolean value that indicates the box’s video support.

[`kern_return_t SetHasMIDI(bool in_has_midi);`](/documentation/AudioDriverKit/IOUserAudioBox/SetHasMIDI)

Sets a Boolean value that indicates the box’s MIDI support.

[`bool HasMIDI();`](/documentation/AudioDriverKit/IOUserAudioBox/HasMIDI)

Returns a Boolean value that indicates the box’s MIDI support.

### Working with Transport Types

[`kern_return_t SetTransportType(IOUserAudioTransportType in_transport_type);`](/documentation/AudioDriverKit/IOUserAudioBox/SetTransportType)

Sets the box’s transport type.

[`IOUserAudioTransportType GetTransportType();`](/documentation/AudioDriverKit/IOUserAudioBox/GetTransportType)

Returns the box’s transport type.

[`enum IOUserAudioTransportType : uint32_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioTransportType)

The type of transport to deliver audio.

## Relationships

### Inherits From

[`IOUserAudioObject`](/documentation/AudioDriverKit/IOUserAudioObject)

---

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)