Table of Contents

Class SoundBase

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Base class for a Sound content.

public abstract class SoundBase : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
SoundBase
Implements
Derived
Inherited Members
Extension Methods

Remarks

Sound is played with a SoundInstance.

Fields

intancesCreationCount

The number of Instances Created so far by this SoundEffect. Used only to give a unique name to the SoundEffectInstance.

protected int intancesCreationCount

Field Value

int

Properties

TotalLength

Gets the total length in time of the Sound.

public TimeSpan TotalLength { get; }

Property Value

TimeSpan

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 abstract 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

Destroy()

Destroys the instance.

protected override void Destroy()

GetCountChannels()

public int GetCountChannels()

Returns

int

RegisterInstance(SoundInstance)

Register a new instance to the soundEffect.

protected void RegisterInstance(SoundInstance instance)

Parameters

instance SoundInstance

new instance to register.