AudioEffectCapture
Exposes raw stereo bus frames through a ring buffer.
AudioEffectCapture copies the signal into a ring buffer without changing sound. Each Vector2 contains left and right float samples at one instant. Check available frame counts before reading; GetBuffer() consumes them.
Set BufferLength before instantiating the effect and read regularly. Overflow increases GetDiscardedFrames(). Capture observes its place in the chain, before that bus's fader/mute; it does not prove physical loudspeaker output.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AudioEffectCaptureConstructor
public AudioEffectCapture();Properties1
BufferLengthProperty
public float BufferLength { get; set; }Requested buffer length in seconds. Set before attaching the effect: allocation happens on first initialization, and changing this property does not promise to resize an allocated queue. Distinct from the total recording cap.
Methods9
CanGetBufferbool
public bool CanGetBuffer(int frames);Returns true if at least frames samples are available to read in the internal ring buffer.
| Name | Type | Default |
|---|---|---|
frames | int | — |
boolClearBuffervoid
public void ClearBuffer();Removes currently unread queued frames. Does not clear your collected-frame list or reset GetDiscardedFrames; handle both in your own new-take logic.
GetBufferVector2[]
public Vector2[] GetBuffer(int frames);Reads and consumes the requested stereo PCM frames from the capture queue. Read regularly; this is not infinite storage or a one-call complete WAV export.
| Name | Type | Default |
|---|---|---|
frames | int | — |
framesFrame count, not byte count. One Vector2 contains left and right channels. Request a positive available count and check the result.
Vector2[]Vector2[] of consumed frames. Insufficient data or a zero request returns an empty array; invalid size or an uninitialized buffer also reports an error.
GetBufferLengthfloat
public float GetBufferLength();floatGetBufferLengthFramesint
public int GetBufferLengthFrames();Returns the total size of the internal ring buffer in number of samples.
intGetDiscardedFrameslong
public long GetDiscardedFrames();Reads accumulated frames discarded due to buffer overflow. Record a baseline for each take and track the difference. ClearBuffer does not reset this counter.
longAccumulated int64 loss count. Growth during a take means PCM continuity was broken.
GetFramesAvailableint
public int GetFramesAvailable();Reads the current frame count available for consumption. Attach the effect to a bus first: effect instantiation initializes the buffer.
intFrame count, not bytes or seconds. This is the current queue, not the total length of a collected recording.
GetPushedFrameslong
public long GetPushedFrames();Returns the number of samples inserted from the audio bus.
longSetBufferLengthvoid
public void SetBufferLength(float bufferLengthSeconds);| Name | Type | Default |
|---|---|---|
bufferLengthSeconds | float | — |