Fields (12) Methods (5)
Namespace: CSCore.XAudio2

Syntax

public struct XAudio2Buffer : IDisposable, ValueType

Base Type

  • System.ValueType

Implements

  • System.IDisposable

Summary

Represents an audio data buffer.

Used by

Fields

AudioBytes

Size of the audio data, in bytes. Must be no larger than MaxBufferBytes for PCM data. For more details see http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directxsdk.xaudio2.xaudio2buffer(v=vs.85).aspx.

public  Int32 AudioBytes

AudioDataPtr

Pointer to the audio data.

public  IntPtr AudioDataPtr

ContextPtr

Context value to be passed back in callbacks to the client. This may be Zero.

public  IntPtr ContextPtr

Flags

Flags that provide additional information about the audio buffer. May be None or EndOfStream.

public  XAudio2BufferFlags Flags

LoopBegin

First sample of the region to be looped. The value of LoopBegin must be less than PlayBegin + PlayLength. LoopBegin can be less than PlayBegin. LoopBegin must be 0 if LoopCount is 0.

public  Int32 LoopBegin

LoopCount

Number of times to loop through the loop region. This value can be between 0 and MaxLoopCount. If LoopCount is zero no looping is performed and LoopBegin and LoopLength must be 0. To loop forever, set LoopCount to LoopInfinite.

public  Int32 LoopCount

LoopInfinite

Infinite Loop.

public const Int32 LoopInfinite

Constant Value

255

LoopLength

Length of the loop region, in samples. The value of LoopBegin + LoopLength must be greater than PlayBegin and less than PlayBegin + PlayLength. LoopLength must be zero if LoopLength is 0. If LoopLength is not 0 then a loop length of zero indicates the entire sample should be looped.

public  Int32 LoopLength

MaxBufferBytes

MaxBufferBytes. See AudioBytes.

public const Int32 MaxBufferBytes

Constant Value

-2147483648

MaxLoopCount

Maximum non-infinite LoopCount.

public const Int32 MaxLoopCount

Constant Value

254

PlayBegin

First sample in the buffer that should be played. For XMA buffers this value must be a multiple of 128 samples.

public  Int32 PlayBegin

PlayLength

Length of the region to be played, in samples. A value of zero means to play the entire buffer, and, in this case, PlayBegin must be zero as well. For more details see http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directxsdk.xaudio2.xaudio2buffer(v=vs.85).aspx.

public  Int32 PlayLength

Methods

XAudio2Buffer()

Represents an audio data buffer.

public void XAudio2Buffer()

XAudio2Buffer(Int32 bufferSize)

Initializes a new instance of the XAudio2Buffer structure.

public void XAudio2Buffer(Int32 bufferSize)

Parameters

bufferSize

Int32

Dispose()

Frees the allocated memory.

public void Dispose()

Free()

Frees the allocated memory.

public void Free()

GetStream()

Returns a UnmanagedMemoryStream instance for the underlying AudioDataPtr.

public Stream GetStream()

Returns

UnmanagedMemoryStream

Remarks

Call