文档

Unity Engine

Unity Engine

ChannelBuffer

Represents a multi-channel audio buffer, allowing channel/frame-based access to the audio samples.
阅读时间1 分钟最后更新于 1 个月前

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 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.