Class XAudioSource
Represents the audio source class.
Inherited Members
Namespace: Evergine.XAudio2
Assembly: Evergine.XAudio2.dll
Syntax
public class XAudioSource : AudioSource
Constructors
XAudioSource(XAudioDevice, WaveFormat)
Initializes a new instance of the XAudioSource class.
Declaration
public XAudioSource(XAudioDevice device, WaveFormat format)
Parameters
Type | Name | Description |
---|---|---|
XAudioDevice | device | The XAudio device. |
WaveFormat | format | The XAudios format. |
Fields
Voice
Gets the source voice.
Declaration
public readonly IXAudio2SourceVoice Voice
Field Value
Type | Description |
---|---|
IXAudio2SourceVoice |
Methods
Apply3D(AudioEmitter)
Sets the 3D properties of the Audio Source according to an audio emitter.
Declaration
public override void Apply3D(AudioEmitter emitter)
Parameters
Type | Name | Description |
---|---|---|
AudioEmitter | emitter | The audio emitter. |
Overrides
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
FlushBuffers()
Flushes all the audio buffers.
Declaration
public override void FlushBuffers()
Overrides
GetPlayPosition()
Gets the playback TimeSpan position of the audio.
Declaration
protected override TimeSpan GetPlayPosition()
Returns
Type | Description |
---|---|
TimeSpan | A TimeSpan with the current playback position. |
Overrides
GetQueuePlayPosition()
Gets the Queue Play TimeSpan position.
Declaration
protected override TimeSpan GetQueuePlayPosition()
Returns
Type | Description |
---|---|
TimeSpan | A TimeSpan with the Queue Play position. |
Overrides
InternalEnqueueBuffer(AudioBuffer, out int?)
Enqueues an audio buffer into the source.
Declaration
protected override void InternalEnqueueBuffer(AudioBuffer buffer, out int? index)
Parameters
Type | Name | Description |
---|---|---|
AudioBuffer | buffer | The buffer to enqueue. |
int? | index | Output variable containing the buffer's index. |
Overrides
InternalPause()
Pauses the audio source.
Declaration
protected override void InternalPause()
Overrides
InternalPlay()
Plays the audio source.
Declaration
protected override void InternalPlay()
Overrides
InternalStop()
Stops the audio source.
Declaration
protected override void InternalStop()
Overrides
IsPaused()
Checks if this audio source is paused.
Declaration
protected override bool IsPaused()
Returns
Type | Description |
---|---|
bool | True if this audio source is paused; false otherwise. |
Overrides
IsPlaying()
Checks if the source is playing.
Declaration
protected override bool IsPlaying()
Returns
Type | Description |
---|---|
bool | True if the audio source is playing; false otherwise. |
Overrides
SetLoop(bool)
Sets a new value to indicate if the source is looped.
Declaration
protected override void SetLoop(bool isLooped)
Parameters
Type | Name | Description |
---|---|---|
bool | isLooped | Indicates if the source should loop the sound. |
Overrides
SetPan(float)
Sets the pan of this audio source.
Declaration
protected override void SetPan(float pan)
Parameters
Type | Name | Description |
---|---|---|
float | pan | The new pan value. |
Overrides
SetPitch(float)
Sets the new pitch of this source.
Declaration
protected override void SetPitch(float pitch)
Parameters
Type | Name | Description |
---|---|---|
float | pitch | The new pitch. |
Overrides
SetQueuePlayPosition(TimeSpan)
Sets the queue play TimeSpan position.
Declaration
protected override void SetQueuePlayPosition(TimeSpan position)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | position | The new TimeSpan position. |
Overrides
SetVolume(float)
Sets the volume of this source.
Declaration
protected override void SetVolume(float volume)
Parameters
Type | Name | Description |
---|---|---|
float | volume | The new volume level. |