Share via


CaptureBuffer.Read(Int32,Stream,Int32,LockFlag) Method (Microsoft.DirectX.DirectSound)

Reads current data in the capture buffer.

Definition

Visual Basic Public Sub Read( _
    ByVal bufferStartingLocation As Integer, _
    ByVal data As StreamLeave Site, _
    ByVal numberBytesToRead As Integer, _
    ByVal flag As LockFlag _
)
C# public void Read(
    int bufferStartingLocation,
    StreamLeave Site data,
    int numberBytesToRead,
    LockFlag flag
);
C++ public:
void Read(
    int bufferStartingLocation,
    StreamLeave Sitedata,
    int numberBytesToRead,
    LockFlag flag
);
JScript public function Read(
    bufferStartingLocation : int,
    data : StreamLeave Site,
    numberBytesToRead : int,
    flag : LockFlag
);

Parameters

bufferStartingLocation System.Int32
An integer that represents the offet, in bytes, of where to begin reading from the capture buffer. This parameter is ignored if LockFlag.FromWriteCursor is specified in the flag parameter.
data System.IO.Stream
A StreamLeave Site object that receives the data read from the capture buffer.
numberBytesToRead System.Int32
An integer that represents the number of bytes read into data from the buffer. The buffer is conceptually circular, so this number can exceed the number of bytes between bufferStartingLocation and the end of the buffer.
flag Microsoft.DirectX.DirectSound.LockFlag
A LockFlag enumerated value that describes the type of lock to perform.

Remarks

Exceptions

ArgumentExceptionLeave Site

An invalid parameter was passed to the called method, or numberBytesToRead is set to zero.

ArgumentNullExceptionLeave Site

One or more parameters is null.

ArgumentOutOfRangeExceptionLeave Site

The ranks parameter is out of range. The maximum number of dimensions for the ranks array is three.

BufferLostException

The buffer memory has been lost and must be restored.

InvalidCallException

The method call is invalid. For example, a method's parameter might not be valid.

NotSupportedExceptionLeave Site

Unable to write to the receiving stream object, data. Check if the stream is writable.

PriorityLevelNeededException

A cooperative level of Priority or higher is required.