Table of Contents

Class StreamedBufferSound

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Sound streamed buffer

public sealed class StreamedBufferSound : SoundBase, IDisposable, IComponent, IReferencable, ICollectorHolder, IMediaExtractor, IMediaReader
Inheritance
StreamedBufferSound
Implements
Inherited Members
Extension Methods

Remarks

The sound comes from an external process (such like a video decoder, ...) streaming the audio data into a buffer

Constructors

StreamedBufferSound(AudioEngine, MediaSynchronizer, string, long, long, bool)

public StreamedBufferSound(AudioEngine engine, MediaSynchronizer scheduler, string mediaDataUrl, long startPosition, long length, bool spatialized)

Parameters

engine AudioEngine
scheduler MediaSynchronizer
mediaDataUrl string
startPosition long
length long
spatialized bool

Properties

MediaCurrentTime

Gets the current presentation time of the media

public TimeSpan MediaCurrentTime { get; }

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

SpeedFactor

Set the play speed of the media

public float SpeedFactor { get; set; }

Property Value

float

Methods

CreateInstance(AudioListener, bool, float, HrtfEnvironment)

Create a new sound effect instance of the sound effect. Each instance that can be played and localized independently from others.

public override SoundInstance CreateInstance(AudioListener listener = null, bool useHrtf = false, float directionalFactor = 0, HrtfEnvironment environment = HrtfEnvironment.Small)

Parameters

listener AudioListener
useHrtf bool
directionalFactor float
environment HrtfEnvironment

Returns

SoundInstance

A new sound instance

Exceptions

ObjectDisposedException

The sound has already been disposed

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

SeekRequestCompleted()

Indicate if a previous seek request has been completed.

public bool SeekRequestCompleted()

Returns

bool