reckfellENGINE

AudioStreamGeneratorPlayback

Stereo PCM queue for one generator playback.

On this page
class AudioStreamGeneratorPlaybackReckfellSharpInherits AudioStreamPlaybackResampled

Obtain this object from a started AudioStreamPlayer using AudioStreamGenerator. Each Vector2 frame contains left and right channels, not time and frequency.

GetFramesAvailable reports writable space. PushBuffer accepts the entire block or rejects it; its bool reports queue acceptance, not playback completion. When input runs out, the mixer inserts zeros and increments GetSkips.

ClearBuffer is allowed only on inactive playback. The generator does not implement ordinary Seek behavior and is not a ready-made microphone/network stream. Use one coordinated data producer.

Complete C# example and troubleshooting.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Methods7

CanPushBufferbool
# CanPushBuffer
C#
public bool CanPushBuffer(int amount);

Checks whether writable space can hold the requested number of stereo frames. This compares capacity; it neither reserves space nor validates data. Use one coordinated producer.

Parameters
NameTypeDefault
amountint—
amount

Nonnegative stereo-frame count to check. This is compared with free space, not validated as a protocol length.

Returns bool

true when the requested frame count fits now; false when writable capacity is smaller.

ClearBuffervoid
# ClearBuffer
C#
public void ClearBuffer();

Clears the queue only on inactive playback and resets its mixed-time counter. During playback the native implementation reports a diagnostic and does not clear it. Do not use this as a seek operation; it does not reset GetSkips.

GetFramesAvailableint
# GetFramesAvailable
C#
public int GetFramesAvailable();

Returns the number of stereo frames currently writable. This is free space, not the number of unplayed frames. It can grow as the mixer consumes audio.

Returns int

Writable stereo-frame capacity. Zero means the queue is full.

GetSkipsint
# GetSkips
C#
public int GetSkips();

Returns the number of internal mix underruns where missing PCM was replaced with zeros. This counts neither missing audio frames nor game frames. Starting playback resets the counter.

Returns int

PCM underrun-event count since playback last started; growth indicates a refill problem.

PushBuffer2 overloads
# PushBuffer · 1/2
C#
public bool PushBuffer(Vector2[] frames);

Copies normalized stereo frames into the queue. If the entire block does not fit, returns false without a partial write. Success means queued, not already played. Preserve oscillator phase or decoder state across blocks.

Parameters
NameTypeDefault
framesVector2[]—
frames

Array or span of stereo frames: X is left, Y is right. Element count is frame count, not the combined sample count of both channels. Supply finite values at a suitable level.

Returns bool

true when the entire block is queued; false when it does not fit. No partial accepted-frame count is returned.

# PushBuffer · 2/2
C#
public bool PushBuffer(ReadOnlySpan<Vector2> frames);

Copies normalized stereo frames into the queue. If the entire block does not fit, returns false without a partial write. Success means queued, not already played. Preserve oscillator phase or decoder state across blocks.

Parameters
NameTypeDefault
framesReadOnlySpan<Vector2>—
frames

Array or span of stereo frames: X is left, Y is right. Element count is frame count, not the combined sample count of both channels. Supply finite values at a suitable level.

Returns bool

true when the entire block is queued; false when it does not fit. No partial accepted-frame count is returned.

PushFramebool
# PushFrame
C#
public bool PushFrame(Vector2 frame);

Appends one stereo frame: Vector2.X is left, Y is right. Returns false when the queue is full. For many frames, use PushBuffer blocks instead of one call per frame.

Parameters
NameTypeDefault
frameVector2—
frame

One normalized stereo frame. X/Y are channel amplitudes, not time and frequency; control finiteness and signal level.

Returns bool

true after queuing the frame; false if no writable slot was available.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.