<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioRoutingArbiter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioRoutingArbiter"
  },
  "title" : "AVAudioRoutingArbiter"
}
-->

# AVAudioRoutingArbiter

An object for configuring macOS apps to participate in AirPods Automatic Switching.

```
class AVAudioRoutingArbiter
```

## Overview

AirPods Automatic Switching is a feature of Apple operating systems that intelligently connects wireless headphones to the most appropriate audio device in a multidevice environment. For example, if a user plays a movie on iPad, and then locks the device and starts playing music on iPhone, the system automatically switches the source audio device from iPad to iPhone.

iOS apps automatically participate in AirPods Automatic Switching. To enable your macOS app to participate in this behavior, use `AVAudioRoutingArbiter` to indicate when your app starts and finishes playing or recording audio. For example, a Voice over IP (VoIP) app might request arbitration before starting a call, and when the arbitration completes, begin the VoIP session. Likewise, when the call ends, the app would end the VoIP session and leave arbitration.

```swift
func startCall() {
    let arbiter = AVAudioRoutingArbiter.shared
    arbiter.begin(category: .playAndRecordVoice) { deviceChanged, error in
        // Start VoIP session.
    }
}

func endCall() {
    // End VoIP session.
    AVAudioRoutingArbiter.shared.leave()
}
```

> Important:
> Only certain Apple and Beats wireless headsets support this feature.

## Topics

### Creating a Routing Arbiter

[`shared`](/documentation/AVFAudio/AVAudioRoutingArbiter/shared)

The shared routing arbiter object.

### Participating in AirPods Automatic Switching

[`begin(category:completionHandler:)`](/documentation/AVFAudio/AVAudioRoutingArbiter/begin(category:completionHandler:))

Begins routing arbitration to take ownership of a nearby Bluetooth audio route.

[`AVAudioRoutingArbiter.Category`](/documentation/AVFAudio/AVAudioRoutingArbiter/Category)

Categories that describe the general nature of your app’s audio use.

[`leave()`](/documentation/AVFAudio/AVAudioRoutingArbiter/leave())

Stops an app’s participation in audio routing arbitration.



---

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)