Class Sound3D
- Namespace
- OmegaEngine.Audio
- Assembly
- OmegaEngine.dll
A memory-cached sound that is played on-demand simulating a position in 3D-space.
public class Sound3D : Sound, IDisposable, IAudio
- Inheritance
-
objectSound3D
- Implements
- Inherited Members
Constructors
Sound3D(XSound)
A memory-cached sound that is played on-demand simulating a position in 3D-space.
public Sound3D(XSound sound)
Parameters
soundXSound
Properties
Attenuation
Factors describing how the sound's volume attenuates with distance from the listener.
public Attenuation Attenuation { get; set; }
Property Value
Position
The sound's position in world space
public DoubleVector3 Position { get; set; }
Property Value
Methods
ApplyVolume()
Applies the current Volume to the active playback (if any).
protected override void ApplyVolume()
CreatePlaybackChain(bool)
Builds the chain of sample providers feeding the mixer for a single playback.
protected override ISampleProvider CreatePlaybackChain(bool looping)
Parameters
loopingboolWhether the playback should loop.
Returns
- ISampleProvider
The top-level sample provider (stereo, SampleRate, IEEE-float).
OnDispose()
Hook that is called when the object needs to dispose its internal resources.
protected override void OnDispose()
OnEnded()
Called when the playback finishes on its own, i.e. not via StopPlayback(). Never called for looping playback.
protected override void OnEnded()
Remarks
Runs on the audio thread while the mixer is producing samples, so overrides must not block.
StartPlayback(bool)
Starts the sound playback
public override void StartPlayback(bool looping)
Parameters
loopingbool
StopPlayback()
Stops the sound playback
public override void StopPlayback()