Class SoundBase
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
Properties
TotalLength
Gets the total length in time of the Sound.
public TimeSpan TotalLength { get; }
Property Value
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
AudioListeneruseHrtf
booldirectionalFactor
floatenvironment
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
RegisterInstance(SoundInstance)
Register a new instance to the soundEffect.
protected void RegisterInstance(SoundInstance instance)
Parameters
instance
SoundInstancenew instance to register.