---
title: ChannelAudioComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/channelaudiocomponent
---

# ChannelAudioComponent

A component that configures channel-based rendering of sounds from an entity.

## Declaration

```swift
struct ChannelAudioComponent
```

## Overview

Overview Channel audio sources route the audio resource’s channels directly to the device’s output without any spatialization or reverberation applied. Neither the position nor orientation of the entity is taken into consideration for channel rendering. For example, the left channel is heard from the left, and the right channel is heard from the right, regardless of where the user is oriented. The channels of multichannel audio resources are panned according to their channel layout, including rear channels. let entity = Entity() let resource = try AudioFileResource.load(named: "MyAudioFile") entity.channelAudio = ChannelAudioComponent() entity.playAudio(resource) The ChannelAudioComponent allows you to set the overall level of all sounds played from the entity with the gain property, in relative Decibels, in the range -.infinity ... .zero where -infinity is silent and .zero is nominal. entity.channelAudio?.gain = -10 Channel audio sources are well suited to play back sounds not associated with any visual elements in a scene.

## Topics

### Initializers

- [init(gain:)](realitykit/channelaudiocomponent/init(gain:).md)

### Instance Properties

- [gain](realitykit/channelaudiocomponent/gain.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)
- [Copyable](swift/copyable.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)

## See Also

### Audio source components

- [Creating a Spaceship game](realitykit/creating-a-spaceship-game.md)
- [Playing spatial audio](visionos/playing-spatial-audio-in-visionos.md)
- [SpatialAudioComponent](realitykit/spatialaudiocomponent.md)
- [AmbientAudioComponent](realitykit/ambientaudiocomponent.md)
