Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ChannelBuffer

Represents a multi-channel audio buffer, allowing channel/frame-based access to the audio samples.
Read time 1 minuteLast updated 5 days ago

Definition

public ref struct ChannelBuffer

Remarks

A ChannelBuffer 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)Creates a new ChannelBuffer instance using the
buffer
as a backing memory store.

Properties

Property

Description

channelCountGets the number of audio channels represented in the buffer.
frameCountGets the number of frame indices available in the buffer.
this[]Gets or sets the sample value at the specified channel and frame.

Methods

Method

Description

ClearSets all samples in the buffer to zero.