reckfellENGINE

VideoStreamPlayback

Contract for a video decoder and audio-frame delivery to a player.

On this page
class VideoStreamPlaybackReckfellSharpInherits Resource

A subclass implements Play/Stop/Paused state, position and duration in seconds, _Update(delta), the current texture and audio properties. Constructing the base resource alone cannot play a file.

_Update receives time advancement already adjusted by the player. MixAudio sends decoded interleaved float samples to the attached sink; it neither captures a microphone nor makes the base class decode video files.

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

Constructors1

VideoStreamPlaybackConstructor
# VideoStreamPlayback
C#
public VideoStreamPlayback();

Creates a base decoder-state container. Does not decode a file without playback-contract overrides.

Methods15

MixAudio2 overloads
# MixAudio · 1/2
C#
public int MixAudio(int numFrames, ReadOnlySpan<float> buffer, int offset);

Sends decoded float samples to the attached player sink. numFrames counts audio frames, buffer interleaves channels, offset indexes float samples. Supply channels × numFrames samples after offset. Returns accepted frames, -1 without a sink/on invalid bounds, or zero for numFrames <= zero. Does not generate sound from an empty array.

Parameters
NameTypeDefault
numFramesint—
bufferReadOnlySpan<float>—
offsetint—
numFrames

Audio frame count rather than total individual channel samples.

buffer

Interleaved float samples sufficient for the requested frames.

offset

Starting float-sample index in buffer.

Returns int

Sends decoded float samples to the attached player sink. numFrames counts audio frames, buffer interleaves channels, offset indexes float samples. Supply channels × numFrames samples after offset. Returns accepted frames, -1 without a sink/on invalid bounds, or zero for numFrames <= zero. Does not generate sound from an empty array.

# MixAudio · 2/2
C#
public int MixAudio(int numFrames, float[] buffer = null, int offset = 0);

Sends decoded float samples to the attached player sink. numFrames counts audio frames, buffer interleaves channels, offset indexes float samples. Supply channels × numFrames samples after offset. Returns accepted frames, -1 without a sink/on invalid bounds, or zero for numFrames <= zero. Does not generate sound from an empty array.

Parameters
NameTypeDefault
numFramesint—
bufferfloat[]null
offsetint0
numFrames

Audio frame count rather than total individual channel samples.

buffer

Interleaved float samples sufficient for the requested frames.

offset

Starting float-sample index in buffer.

Returns int

Sends decoded float samples to the attached player sink. numFrames counts audio frames, buffer interleaves channels, offset indexes float samples. Supply channels × numFrames samples after offset. Returns accepted frames, -1 without a sink/on invalid bounds, or zero for numFrames <= zero. Does not generate sound from an empty array.

_GetChannelsint
# _GetChannels
C#
public virtual int _GetChannels();

Return actual interleaved audio channel count; zero means no audio. Match the MixAudio buffer layout.

Returns int

Return actual interleaved audio channel count; zero means no audio. Match the MixAudio buffer layout.

_GetLengthdouble
# _GetLength
C#
public virtual double _GetLength();

Return duration in seconds; zero may indicate unknown duration. Not milliseconds or frame count.

Returns double

Return duration in seconds; zero may indicate unknown duration. Not milliseconds or frame count.

_GetMixRateint
# _GetMixRate
C#
public virtual int _GetMixRate();

Return decoded audio sample rate in Hz, such as 48000. Not the number of samples in the current block.

Returns int

Return decoded audio sample rate in Hz, such as 48000. Not the number of samples in the current block.

_GetPlaybackPositiondouble
# _GetPlaybackPosition
C#
public virtual double _GetPlaybackPosition();

Return the current position in seconds using a consistent audio/video timeline.

Returns double

Return the current position in seconds using a consistent audio/video timeline.

_GetTextureTexture2D
# _GetTexture
C#
public virtual Texture2D _GetTexture();

Return the decoded frame’s current Texture2D. A stable updated resource avoids continually creating textures; null means no texture.

Returns Texture2D

Return the decoded frame’s current Texture2D. A stable updated resource avoids continually creating textures; null means no texture.

_IsPausedbool
# _IsPaused
C#
public virtual bool _IsPaused();

Return your implementation’s stored pause state.

Returns bool

Return your implementation’s stored pause state.

_IsPlayingbool
# _IsPlaying
C#
public virtual bool _IsPlaying();

Return actual playback state. Return false after natural completion so VideoStreamPlayer can handle Loop/Finished. Do not conflate pausing with movie completion.

Returns bool

Return actual playback state. Return false after natural completion so VideoStreamPlayer can handle Loop/Finished. Do not conflate pausing with movie completion.

_Playvoid
# _Play
C#
public virtual void _Play();

Implement starting your playback. Define/document repeated-start behavior; the base C# method is empty.

_Seekvoid
# _Seek
C#
public virtual void _Seek(double time);

Implement seeking to time in seconds, validating bounds and restoring decoder state. The base method cannot seek.

Parameters
NameTypeDefault
timedouble—
time

Target position in seconds.

_SetAudioTrackvoid
# _SetAudioTrack
C#
public virtual void _SetAudioTrack(int idx);

Handle the audio-track index according to your format. Neither a bus index nor a channel count.

Parameters
NameTypeDefault
idxint—
idx

Audio-track index.

_SetPausedvoid
# _SetPaused
C#
public virtual void _SetPaused(bool paused);

Store pause state and suspend decoder advancement without losing required state.

Parameters
NameTypeDefault
pausedbool—
paused

Pause advancement without ending the stream.

_Stopvoid
# _Stop
C#
public virtual void _Stop();

Implement stopping and cleaning up the decoder. Your implementation defines position reset, not the empty base C# method.

_Updatevoid
# _Update
C#
public virtual void _Update(double delta);

Advance decoding by delta seconds and update frame/audio data. The player already applies time scaling; do not multiply again without a reason. Invocation count is not a fixed frame rate.

Parameters
NameTypeDefault
deltadouble—
delta

Time advancement in seconds, already scaled by the player.

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.