Table of Contents

Interface IPositionableSound

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Interface for 3D localizable sound. The interface currently supports only mono and stereo sounds (ref Pan). The user can localize its sound with Apply3D(AudioEmitter) by creating one AudioEmitter and one AudioListener respectly corresponding to the source of the sound and the listener. The Pan function enable the user to change the distribution of sound between the left and right speakers.

public interface IPositionableSound : IPlayableSound
Inherited Members

Remarks

Functions Pan and Apply3D(AudioEmitter) cannot be used together. A call to Apply3D(AudioEmitter) will reset Pan to its default value and inverse.

Properties

Pan

Set the sound balance between left and right speaker.

float Pan { get; set; }

Property Value

float

Remarks

Panning is ranging from -1.0f (full left) to 1.0f (full right). 0.0f is centered. Values beyond this range are clamped. Panning modifies the total energy of the signal (Pan == -1 => Energy = 1 + 0, Pan == 0 => Energy = 1 + 1, Pan == 0.5 => Energy = 1 + 0.5, ...)

A call to Pan cancels the effect of Apply3D.

Pitch

Gets or sets the pitch of the sound, might conflict with spatialized sound spatialization.

float Pitch { get; set; }

Property Value

float

Methods

Apply3D(AudioEmitter)

Applies 3D positioning to the sound. More precisely adjust the channel volumes and pitch of the sound, such that the sound source seems to come from the emitter to the listener/>.

void Apply3D(AudioEmitter emitter)

Parameters

emitter AudioEmitter

The emitter that correspond to this sound

Remarks

Apply3D(AudioEmitter) can be used only on mono-sounds.

A call to Apply3D(AudioEmitter) reset Pan to its default values.

A call to Apply3D(AudioEmitter) does not modify the value of Volume, the effective volume of the sound is a combination of the two effects.

The final resulting pitch depends on the listener and emitter relative velocity. The final resulting channel volumes depend on the listener and emitter relative positions and the value of Volume.

See Also