# ChannelBuffer

> Represents a multi-channel audio buffer, allowing channel/frame-based access to the audio samples.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.Audio](/engine/6000.7/script-reference/unityengine/audio.md)
* **Assembly:** UnityEngine.AudioModule

```csharp
public ref struct ChannelBuffer
```

## Remarks

A [ChannelBuffer](/engine/6000.7/script-reference/unityengine/audio/channelbuffer.md) provides a uniform interface for audio processing code regardless of how the samples are stored, internally. When using such a buffer together with Unity APIs, Unity will interpret the buffer layout as get/set through the indexer.

## Constructors

| Constructor                                                                                                                        | Description                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ChannelBuffer(System.Span\{System.Single},System.Int32)](/engine/6000.7/script-reference/unityengine/audio/channelbuffer/ctor.md) | Creates a new [ChannelBuffer](/engine/6000.7/script-reference/unityengine/audio/channelbuffer.md) instance using the `buffer` as a backing memory store. |

## Properties

| Property                                                                                        | Description                                                       |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [channelCount](/engine/6000.7/script-reference/unityengine/audio/channelbuffer/channelcount.md) | Gets the number of audio channels represented in the buffer.      |
| [frameCount](/engine/6000.7/script-reference/unityengine/audio/channelbuffer/framecount.md)     | Gets the number of frame indices available in the buffer.         |
| [this\[\]](/engine/6000.7/script-reference/unityengine/audio/channelbuffer/item.md)             | Gets or sets the sample value at the specified channel and frame. |

## Methods

| Method                                                                            | Description                             |
| --------------------------------------------------------------------------------- | --------------------------------------- |
| [Clear](/engine/6000.7/script-reference/unityengine/audio/channelbuffer/clear.md) | Sets all samples in the buffer to zero. |
