Table of Contents

Class StreamedBufferSoundSource

Namespace
Stride.Audio
Assembly
Stride.Audio.dll
public class StreamedBufferSoundSource : DynamicSoundSource, IDisposable, IMediaExtractor, IMediaReader
Inheritance
StreamedBufferSoundSource
Implements
Inherited Members
Extension Methods

Constructors

StreamedBufferSoundSource(SoundInstanceStreamedBuffer, MediaSynchronizer, string, long, long)

public StreamedBufferSoundSource(SoundInstanceStreamedBuffer instance, MediaSynchronizer synchronizer, string mediaDataUrl, long startPosition, long length)

Parameters

instance SoundInstanceStreamedBuffer
synchronizer MediaSynchronizer
mediaDataUrl string
startPosition long
length long

Properties

CanFill

Checks if a buffer can be filled, before calling FillBuffer this should be checked.

protected override bool CanFill { get; }

Property Value

bool

Channels

public int Channels { get; }

Property Value

int

IsDisposed

Specifies if the extractor has been disposed

public bool IsDisposed { get; }

Property Value

bool

MaxNumberOfBuffers

Max number of buffers that are going to be queued.

public override int MaxNumberOfBuffers { get; }

Property Value

int

MediaCurrentTime

Gets the current presentation time of the media

public TimeSpan MediaCurrentTime { get; set; }

Property Value

TimeSpan

MediaDuration

Returns the total duration of the media

public TimeSpan MediaDuration { get; }

Property Value

TimeSpan

MediaType

Returns the type of media that is extracted

public MediaType MediaType { get; }

Property Value

MediaType

PlayRange

Gets or sets the region of time to play from the audio clip.

public override PlayRange PlayRange { get; set; }

Property Value

PlayRange

SampleRate

public int SampleRate { get; }

Property Value

int

SpeedFactor

Set the play speed of the media

public float SpeedFactor { get; set; }

Property Value

float

Methods

DisposeInternal()

Destroys the instance.

protected override void DisposeInternal()

ExtractAndFillData()

protected override void ExtractAndFillData()

InitializeInternal()

protected override void InitializeInternal()

PrepareInternal()

Prepare the source for playback

protected override void PrepareInternal()

ReachedEndOfMedia()

Specifies if the end of the media has been reached.

public bool ReachedEndOfMedia()

Returns

bool

Seek(TimeSpan)

Seek to provided position in the media source.

public void Seek(TimeSpan mediaTime)

Parameters

mediaTime TimeSpan

SeekInternal()

Should be called from working thread only (or add proper locks)

protected override void SeekInternal()

SeekRequestCompleted()

Indicate if a previous seek request has been completed.

public bool SeekRequestCompleted()

Returns

bool

SetLooped(bool)

Sets if the stream should be played in loop

public override void SetLooped(bool loop)

Parameters

loop bool

if looped or not

UpdateInternal()

Update the sound source

protected override void UpdateInternal()