Search Results for

    Show / Hide Table of Contents

    Class XAudioSource

    Represents the audio source class.

    Inheritance
    object
    AudioSource
    XAudioSource
    Inherited Members
    AudioSource.Format
    AudioSource.Volume
    AudioSource.Pan
    AudioSource.Pitch
    AudioSource.IsLooped
    AudioSource.State
    AudioSource.PlayPosition
    AudioSource.QueuePlayPosition
    AudioSource.QueueDuration
    AudioSource.CurrentBuffer
    AudioSource.PendingBuffers
    AudioSource.PendingBuffersCount
    AudioSource.BufferStarted
    AudioSource.BufferEnded
    AudioSource.EnqueueBuffer(AudioBuffer)
    AudioSource.Play()
    AudioSource.Pause()
    AudioSource.Stop()
    AudioSource.OnBufferStart()
    AudioSource.OnBufferProccessed(bool)
    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
    AudioSource.Apply3D(AudioEmitter)

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public override void Dispose()
    Overrides
    AudioSource.Dispose()

    FlushBuffers()

    Flushes all the audio buffers.

    Declaration
    public override void FlushBuffers()
    Overrides
    AudioSource.FlushBuffers()

    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
    AudioSource.GetPlayPosition()

    GetQueuePlayPosition()

    Gets the Queue Play TimeSpan position.

    Declaration
    protected override TimeSpan GetQueuePlayPosition()
    Returns
    Type Description
    TimeSpan

    A TimeSpan with the Queue Play position.

    Overrides
    AudioSource.GetQueuePlayPosition()

    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
    AudioSource.InternalEnqueueBuffer(AudioBuffer, out int?)

    InternalPause()

    Pauses the audio source.

    Declaration
    protected override void InternalPause()
    Overrides
    AudioSource.InternalPause()

    InternalPlay()

    Plays the audio source.

    Declaration
    protected override void InternalPlay()
    Overrides
    AudioSource.InternalPlay()

    InternalStop()

    Stops the audio source.

    Declaration
    protected override void InternalStop()
    Overrides
    AudioSource.InternalStop()

    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
    AudioSource.IsPaused()

    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
    AudioSource.IsPlaying()

    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
    AudioSource.SetLoop(bool)

    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
    AudioSource.SetPan(float)

    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
    AudioSource.SetPitch(float)

    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
    AudioSource.SetQueuePlayPosition(TimeSpan)

    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.

    Overrides
    AudioSource.SetVolume(float)

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX