Table of Contents

Class Sound

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Sound content.

[ContentSerializer(typeof(DataContentSerializer<Sound>))]
[DataSerializerGlobal(typeof(ReferenceSerializer<Sound>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
[DataSerializer(typeof(SoundSerializer))]
public sealed class Sound : SoundBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
Sound
Implements
Inherited Members
Extension Methods

Remarks

Sound is played with a SoundInstance.

Methods

CreateInstance(AudioListener, bool, bool, float, HrtfEnvironment)

Create a new sound effect instance of the sound effect. The audio data are shared between the instances so that useless memory copies is avoided. Each instance that can be played and localized independently from others.

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

Parameters

listener AudioListener
forceLoadInMemory bool
useHrtf bool
directionalFactor float
environment HrtfEnvironment

Returns

SoundInstance

A new sound instance

Exceptions

ObjectDisposedException

The sound has already been disposed

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

Destroy()

Destroys the instance.

protected override void Destroy()