---
title: "messageChannel(for:)"
framework: audiotoolbox
role: symbol
role_heading: Instance Method
path: "audiotoolbox/auaudiounit/messagechannel(for:)"
---

# messageChannel(for:)

Returns an object for bidirectional communication between an audio unit and its host.

## Declaration

```swift
func messageChannel(for channelName: String) -> any AUMessageChannel
```

## Parameters

- `channelName`: The name of the message channel the audio unit returns.

## Return Value

Return Value An object that conforms to AUMessageChannel.

## Discussion

Discussion Message channels provide a way for custom data exchanges between an audio unit and its host. An audio unit may support multiple message channels. The host manages the message channel object’s lifetime. Design message channel objects so they can outlive the audio unit that vended them.

## See Also

### Messaging Channels

- [AUMessageChannel](audiotoolbox/aumessagechannel.md)
