Class SoundEmitter3D
This class represent a Sound emitter in a 3D environment.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Components.Sound
Assembly: Evergine.Components.dll
Syntax
public class SoundEmitter3D : Behavior, IDependencyObject
Constructors
SoundEmitter3D()
Initializes a new instance of the SoundEmitter3D class.
Declaration
public SoundEmitter3D()
Fields
Apply3D
Apply sound 3D effects.
Declaration
public bool Apply3D
Field Value
Type | Description |
---|---|
bool |
Properties
Audio
Gets or sets the sound source.
Declaration
public AudioBuffer Audio { get; set; }
Property Value
Type | Description |
---|---|
AudioBuffer |
DistanceScaleFactor
Gets or sets the distance scale factor of sound emitter.
Declaration
public float DistanceScaleFactor { get; set; }
Property Value
Type | Description |
---|---|
float |
IsMuted
Gets or sets a value indicating whether the sound emitter is muted.
Declaration
public bool IsMuted { get; set; }
Property Value
Type | Description |
---|---|
bool |
Loop
Gets or sets a value indicating whether current sound is looping.
Declaration
public bool Loop { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Pitch
Gets or sets the pitch of sound emitter.
Declaration
[RenderPropertyAsFInput(MinLimit = 0.01, MaxLimit = 1, AsSlider = true, DesiredChange = 0.01, DesiredLargeChange = 0.02)]
public float Pitch { get; set; }
Property Value
Type | Description |
---|---|
float |
PlayAutomatically
Gets or sets a value indicating whether the sound is played automatically when the SoundPath is refreshed.
Declaration
public bool PlayAutomatically { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
PlayState
Gets the play state of this emitter.
Declaration
public PlayState PlayState { get; }
Property Value
Type | Description |
---|---|
PlayState |
Volume
Gets or sets the volume of sound emitter.
Declaration
[RenderPropertyAsFInput(MinLimit = 0.01, MaxLimit = 1, AsSlider = true, DesiredChange = 0.01, DesiredLargeChange = 0.02)]
public float Volume { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
OnActivated()
Invoked when the object is activated once is attached.
Declaration
protected override void OnActivated()
Overrides
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
OnDeactivated()
Invoked when the object is deactivated.
Declaration
protected override void OnDeactivated()
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
OnLoaded()
Invoked when the object is loaded.
Declaration
protected override void OnLoaded()
Overrides
Pause()
Play the current sound.
Declaration
public void Pause()
Play()
Play the current sound.
Declaration
public void Play()
Start()
Invoked to start the object.
Declaration
protected override void Start()
Overrides
Stop()
Play the current sound.
Declaration
public void Stop()
Update(TimeSpan)
Update 3d instance.
Declaration
protected override void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The game time. |
Overrides
Events
OnAudioEnd
Event fired when the playing audio has finished
Declaration
public event EventHandler<AudioBuffer> OnAudioEnd
Event Type
Type | Description |
---|---|
EventHandler<AudioBuffer> |