---
title: "begin(category:completionHandler:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudioroutingarbiter/begin(category:completionhandler:)"
---

# begin(category:completionHandler:)

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

## Declaration

```swift
func begin(category: AVAudioRoutingArbiter.Category, completionHandler handler: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```swift
func begin(category: AVAudioRoutingArbiter.Category) async throws -> Bool
```

## Parameters

- `category`: A category that describes how the app uses audio.
- `handler`: A completion handler the system calls asynchronously when the system completes audio routing arbitration. This closure takes the following parameters:

## Discussion

Discussion Call this method to tell the operating system to arbitrate with nearby Apple devices to take ownership of a supported Bluetooth audio device. When arbitration completes, the system calls the completion handler, passing a Boolean that indicates whether the audio device changed. In either case, begin using audio as normal.

## See Also

### Participating in AirPods Automatic Switching

- [AVAudioRoutingArbiter.Category](avfaudio/avaudioroutingarbiter/category.md)
- [leave()](avfaudio/avaudioroutingarbiter/leave().md)
