<!--
{
  "availability" : [
    "DriverKit: 21.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioDriverKit",
  "identifier" : "/documentation/AudioDriverKit/IOUserAudioBox/AddDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AudioDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserAudioBox@F@AddDevice#*$@S@IOUserAudioDevice#"
  },
  "title" : "AddDevice"
}
-->

# AddDevice

Adds an audio device to the audio box.

```
kern_return_t AddDevice(IOUserAudioDevice *in_device);
```

## Parameters

`in_device`

The [`IOUserAudioDevice`](/documentation/AudioDriverKit/IOUserAudioDevice) to associate with the box.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. For a list of error codes, see <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

The box doesn’t own the device.

If adding the device succeeds, the device’s reference count increments by one.

---

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)