Class XAudioSource
The audio source class.
Implements
Inherited Members
Namespace: Evergine.XAudio2
Assembly: Evergine.XAudio2.dll
Syntax
public class XAudioSource : AudioSource, IDisposable
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 ·D 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()
Declaration
public override void Dispose()
Overrides
FlushBuffers()
Flush all the audio buffers.
Declaration
public override void FlushBuffers()
Overrides
GetPlayPosition()
Gets the play TimeSpan position of the audio.
Declaration
protected override TimeSpan GetPlayPosition()
Returns
Type | Description |
---|---|
TimeSpan | A TimeSpan with the current play 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 be enqueued. |
int? | index | Output variable containing the buffer 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 pause. 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 | If the source must 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. |
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. |